Fernando,
> Does D6 include kernel threads, or does it still use 'green-theads'?
> If it still uses green threads, then why? Wouldn't the performance of
> multithreaded apps improve with kernel threads and avoid the OS from
> blocking the whole process when a thread starts a network connection
> (for example)?
D6 uses green threads. There are several reasons for this, perhaps the
most obvious being that it would be a great deal of work to make the
existing virtual machine and low-level memory management
multithread-safe. Also, the act of doing this would almost certainly
slow down the overall performance of the VM.
In order to avoid the situation that you cite above (where the OS is
required to block the current thread for some activity) we provide
"overlapped calls" which are generally sufficient for a great many
situations. You can read about overlapped calls here:
http://www.object-arts.com/docs/overlappedcalls.htmThe main area of deficiency in the overlapped call arena is that we
don't yet have the ability to overlap COM calls which would be a
nice-to-have in some situations.
There are also a number of advantages to green threads. They are
generally much faster to start than native threads and there is no
fundamental upper limit to the number of green threads that can be
hosted in the Smalltalk image. James Robertson has commented about
green threads in VisualWorks in his blog:
http://www.cincomsmalltalk.com/blog/blogView?showComments=true&entry=3303013147
AFAIK, Smalltalk MT is the only current Smalltalk that is available
using native OS threads.
Best Regards,
--
Andy Bower
Dolphin Support
www.object-arts.com