--- portable OS threads ---
Last night, I got an OS threaded call-out mechanism working. I've created three pluggable primitives
primitiveCallOut primitiveThreadedCallOut primitiveThreadedCallOutResult
I've abstracted the machine code necessary to actually do the call out to ensure portability. This abstraction and the machine code reside in the image (in instances of ExternalByteArray). These primitives simply call the machine code for the desired calling mechanism.
Thus, these primitives are highly portable, except where the native threads come in to the picture. My first cut is using tthreads http://www.upl.cs.wisc.edu/~stanis/tthread.html ; thanks to Greg A. for the pointer), a C++ abstraction that provides portability between pthreads (POSIX) and win32 threads.
Does the Mac support pthreads? I'm trying to determine what level of portability I actually have here.
--- process priority ---
In Squeak (under Windows), when I fork a process at user background priority, it seems to never run (or at least it takes a very long time). Is there a way to have user background priority processes to run in a more timely fashion. I was creating about 100 processes to test the threaded call out, and everything worked great, except when I use the user level priority, the UI (MVC) seems to slow down. I'd like to be able to make threaded call outs, leaving plenty of processing to handle the UI, but also having the call-out execute in a more timely manner.
Can anyone shed some light on how to do this? Also, I was planning to default to user interrupt priority to handle call-ins to Squeak, does that sound reasonable?
Thanks, Stephen
Content-Type: application/octet-stream; name="Stephen Pair.vcf" Content-Disposition: attachment; filename="Stephen Pair.vcf"
Attachment converted: Anon:Stephen Pair.vcf 6 (????/----) (0000A921)
Hi,
Stephen Pair writes:
--- portable OS threads ---
Last night, I got an OS threaded call-out mechanism working. I've created three pluggable primitives
primitiveCallOut primitiveThreadedCallOut primitiveThreadedCallOutResult
Great!
Does the Mac support pthreads? I'm trying to determine what level of portability I actually have here.
The mac does support Threads, but, I'm not sure it supports pthreads. It's possible that a shell could be written on top of POSIX threads to blend it into the Mac Thread Manager. Also, while the thread manager does premptive threads, it's probably a bit tricky to get this to work properly. Most likely one would have to settle for cooperative threads.
cheers
bruce
At 07:06 99-06-02 -0400, you wrote:
--- portable OS threads ---
Last night, I got an OS threaded call-out mechanism working. I've created three pluggable primitives
primitiveCallOut primitiveThreadedCallOut primitiveThreadedCallOutResult
I've abstracted the machine code necessary to actually do the call out to ensure portability. This abstraction and the machine code reside in the image (in instances of ExternalByteArray). These primitives simply call the machine code for the desired calling mechanism.
Thus, these primitives are highly portable, except where the native threads come in to the picture. My first cut is using tthreads http://www.upl.cs.wisc.edu/~stanis/tthread.html ; thanks to Greg A. for the pointer), a C++ abstraction that provides portability between pthreads (POSIX) and win32 threads.
Does the Mac support pthreads? I'm trying to determine what level of portability I actually have here.
There's a good article on portability and threads in the #300 (June 1999) issue of Dr. Dobb's Journal where they describe protability issues on Mac and Windows... Unfortunately, the code is in C++ but I'd say it's a good start ____________________________________________________________________________ Benoit St-Jean Creative Technologies International 871-8585 #234 1440 Ste-Catherine ouest, Bureau 400 email (work) : bstjean@creative.ca Montreal, Quebec, Canada, H3C 3R7 (home) : lamneth@aei.ca
The opinions expressed in this message are my own personal views and do not reflect the official views of CTI
squeak-dev@lists.squeakfoundation.org