Chris Stith wrote:

> Considering that the major win which comes with threading is more
> speed and that most of the time in a program is spent waiting for
> I/O events, it would be of great value to be able to do file, pipe,
> and socket I/O from within threads even if most system calls wouldn't
> work.

You can't even do that sensibly because Ithreads don't share IO handles (see
Sarathay's mail).  There are also other alternatives to threads for handling
asynchronous IO - did I hear someone say 'event dispatcher'?

> An even better idea is to tell the user to make sure all the
> non-threadsafe work gets done in the same thread, and that the
> other threads be allowed to do whatever they can with the subset
> which is thread-safe. Perhaps we could make sure that when someone
> creates new threads, the original main thread cannot creat a new
> thread which will do non-threadsafe calls of Perl builtins, and
> that any outside libraries (XS modules, etc.) be declared thread-safe
> by the user before the user can put calls to the library functions
> in the subset-only threads.

And we can always solve world hunger at the same time, can't we?

> This is nothing but a workaround, but it's better than not having
> threads.

As in having 40 pairs of shoes and no legs is obviously better than having
two legs and being barefoot.

Alan Burlison

Reply via email to