Xojo Conferences
XDCMay2019MiamiUSA

[MBS] Pre-emptive Threading a bad idea? (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] REALbasic 2008r2 and Plugin compatibility
Next thread: [MBS] Is there any way to paste text into another application?


RE: [MBS] DOM classes for Mac OS X HTMLViewer   -   Giovanni
  [MBS] Pre-emptive Threading a bad idea?   -   dazz
   Re: [MBS] Pre-emptive Threading a bad idea?   -   Christian Schmitz

[MBS] Pre-emptive Threading a bad idea?
Date: 10.03.08 00:52 (Mon, 10 Mar 2008 00:52:38 +0100)
From: dazz
i was getting some news when i read this :
http://alacatialabs.com/2008/03/05/moral-of-the-story-part-2ish/

Pre-emptive Threading
There are several libraries that claim to offer this in REALbasic. The
problem is that it can’t be done. The RB runtime simply isn’t thread
safe, not to mention the framework itself!

Something as trivial as referencing a string has the potential to
bring down your whole application in bizarre and difficult-to-detect
ways. Even if your code doesn’t directly touch the runtime, the code
the compiler generates might. The rules on when it does so (to yield
to another thread, for example) are undocumented and extremely likely
to change from version to version.

To make a long story short: it’s a bad idea.


mmm

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
http://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Pre-emptive Threading a bad idea?
Date: 10.03.08 01:51 (Mon, 10 Mar 2008 01:51:04 +0100)
From: Christian Schmitz
dazz <<email address removed>> wrote:

> i was getting some news when i read this :
> http://alacatialabs.com/2008/03/05/moral-of-the-story-part-2ish/

Well, someone seems not to like those two plugin things.
My weakmbs class will not crash as it keeps an object with the strong
reference.

> Pre-emptive Threading
> There are several libraries that claim to offer this in REALbasic. The
> problem is that it can't be done. The RB runtime simply isn't thread
> safe, not to mention the framework itself!

Well, I added LockRuntime to handle the framework reentrancy problems.

Still if you access global variables from your threads, you may crash
everything.

Gruß
Christian

-