On May 30, 2008, at 8:22 AM, Bart Silverstrim wrote:
> Joe Strout wrote:
>
>> The Windows
>> platform layer used to use preemptive threads, and it was a nightmare
>> -- one that ended only when they coded a cooperative multitasking
>> system like the Mac already had.
>
> Could you elaborate on this? I thought all NT lineage was preemptively
> multitasking, with a Win16 compatibility system for older applications
> that was cooperatively multitasked within itself...?
Yes, native Windows threads, like native Mac OS X (and Linux) threads,
are preemptive. This sounds attractive, but in practice, usually
causes all sorts of subtle problems. So RB doesn't use them. It uses
its own cooperative threading model, which is safe and works the same
on all platforms.
>> To make use of multiple processors safely (in ANY language), you need
>> to divide your work into separate processes. In RB, the best way to
>> do this is via a helper app that you would access via the Shell.
>> It's
>> not that hard to do, and it's 100% safe.
>
> You're saying design your app to be multiprocess and not
> multithreaded?
Yes, exactly. Separate processes will be scheduled preemptively and,
on multicore machines, may be distributed across the multiple cores.
Yet because they're separate processes and don't share memory, all the
subtle thread-safety issues that plague preemptively multithreaded
programs simply go away.
Best,
- Joe
--
Joe Strout
Inspiring Applications, Inc.
http://www.InspiringApps.com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|