On 31-Jul-08, at 8:49 AM, Miller, James T. wrote:
Does not seem to be a lot of information around on threads in RB.
So here
are a couple simple question:
1- If I run multiple threads (2 or 3) on a Mac with 4 CPUs, does
each thread
execute on its own CPU, i.e., is there a processing boost to using
threads
in this case.
No
2 - What happens if a thread (or several threads) calls a method
that is not
in the thread, e.g., a method defined in the window class that
initiated the
thread? In particular, are such methods re-enterant, i.e., if one
thread
calls the method while the other is still using the same method,
will the
processing in the method execute properly for both calls (seems to
in my
testing).
The method is executed within the threads context and is part of the
thread
This is ok and reentrant since RB threads are cooperative and managed
by the RB runtime
The problem is preemptive threads where RB completely loses control
and switches of context from one thread to another can happen at ANY
time completely outside of the runtimes control
That's what can cause the issue as the runtime itself could be left
in a weird state and behave incorrectly
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|