native threads

Nicolas Roard nicolas at roard.com
Fri Apr 15 12:42:41 UTC 2005


Le 14 avr. 05, à 19:24, Giovanni Giorgi a écrit :

>
> --- Tim Rowledge <tim at sumeru.stanford.edu> wrote:
>> Ramiro Diaz Trepat <ramirodt at gmail.com> wrote:
>>
>>> I believe that no serious server software will ever be possible
>>> without preemtive multitasking, probably no client sofware either.
>> Really? Have you not read about SeaSide, possibly the best webserver
>> around?
>
> Native threads are userful because of  preemptive mutlitasking.
> See the difference of stability of Mac OS System 9/8/7 and Mac Os X.
> We can live without preemptive mutlitasking, (we lived without it in a
> lot of system until 1995 and beyond).
> But if you want to develop a good server in a very *simple* way you
> definitevely need it at least in some situation.
>
> It is too difficult to develop a multi-request server without native
> threads: a single bug can stuck yoour beautiful server.
>
> It would be interesting to have a nice FFI dll for squeak, to enable
> it... :)
> my 2 cents ;)

Er... if I understand well, squeak threads are not preemptable by 
another thread of the same level -- hence the yield. But they are 
preemptable by a thread of a higher level, so what exactly is the 
problem ??? If you absolutely need to preempt threads for your server, 
just create a thread "controller" that will preempt your threads... the 
difference is that you need to do the job instead of letting the 
operating system do it (doesn't seem very difficult anyway, and perhaps 
a simple implementation of that kind of code would be nice to have in 
the image); the advantage is a very low cost of task switching and you 
can have much more threads than by using native threads.

I guess another interesting approach would be like the "thin threads" 
described by göran, used by JRockit : pool of green threads in native 
threads (so that the native threads are distributed on multiple 
processors..)

-- 
Nicolas Roard



More information about the Squeak-dev mailing list