On Jul 31, 2008, at 7: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.
RB Threads are cooperative and run "inside" the application's main
process. Unfortunately, this means that you'll always be stuck on a
single processor unless you use an external solution such as MBS, your
own pthreads calls, or externally shelled tools.
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).
That has also been my experience, but I make sure that any external
references are to "Self" or "Me" to make sure that I don't somehow get
the threads using the same global level properties.
Tim
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|