At 01:17 PM 8/4/00 +0500, Tom Scola wrote:
> >[I think this belongs on the language list, FWIW, Cc'd there]
> >
> >I like this, but I'd like to see this, inter-thread queues, and events
>all
> >use the same communication method. Overload filehandles to pass events
>
> >around instead, so:
>
>I'm proposing that events and threads be dropped in lieu of coroutines.

Not gonna happen. Tk and signals, at the very least, will see to that. 
Coroutines are also an awfully limited threading mechanism, and I think 
they'd have the same problems that threads have (or the use of multiple 
processors in an SMP system would be shot), so it seems silly to limit 
threading to coroutines.

Might as well do 'em all, though the low-level contstructs (i.e. what we 
build) may overlap a bunch.

>  I view events and threads as low-level attempts to implement what coroutines
>express elegantly.

In some ways, sure. In others, no.

>There would be two perl run-times, one event-based and the other thread
>based, much like java green threads and native threads.

Ah. Don't think so. Code duplication is Evil, and I'd rather have a unified 
interpreter.

> > Invoking the coroutine could use another keyword,
> >perhaps invoke, that returns the filehandle the coroutine talks on. So:
>
> >
> >   $fh = invoke foo("1", "2", "3")
>
>As I tried to explain in the RFC, the "invoke" keyword be redundant.  Writing
>to, or reading from the filehandle would invoke the coroutine.

You're overloading filehandle syntax way too much, and parameter passing's 
nasty that way.

   $foo = <|coroutine "bar", "baz">;

Yech. Ugly.

> >This would necessitate the expansion of select to check for pending
> >events/coroutine writes/data, but that's likely to happen anyway, so...
>
>
>In my proposed event-based perl runtime, the select loop would be hidden
>from the programmer.  All I/O calls would be non-blocking and context 
>switching.

I meant select the perl construct, not select the low-level construct.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to