From: Alexander Traud <alexander dot traud at macnews dot de>
Date: Thu, 29 Dec 2005 23:26:24 +0100
The REALbasic thread scheduler is cooperative based, even in Mac OS
X Mach-O
builds. Good to know. Would not hurt to mentioned this in the
documentation.
For example I call an external function with takes several seconds
(up to
minutes depending how bad I am) to return and never calls
YieldToAnyThread
because it is function build for Mac OS X. No chance with a REALbasic
Thread.
Is there an easy way to build a preemptive thread for such a function
calling YieldToXXXThread never ever?
The simple answer is no (barring some nasty voodoo I'm sure some
others will mention here that I wouldn't be prepared to bet on
myself). But I've long thought that if I really wanted to do the
moral equivalent of preemptive threading entirely in REALbasic, I
could split my app into GUI and console app sides, and set up
suitable communication between the two using a socket or some such.
Once an app had such a split, it would be possible to take great
advantage of 2 or 4 processors, as well.
It would be a pain to do in general, but for certain problems, it
would be relatively straightforward. On OS X, you can even put the
console app inside a bundle, I believe.
Guyren G Howe
guyren-at-relevantlogic.com
http://relevantlogic.com
REALbasic, PHP, Python programming
PostgreSQL, MySQL database design and consulting
Technical writing and training
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|