On Mon, 16 Feb 2009, Daniel Ruoso wrote:
Em Seg, 2009-02-16 às 17:28 +1100, Timothy S. Nelson escreveu:
Say I wanted to write a POP3 server. I want to receive a username and
password from the client. I want things to be interruptable during this, but
it's also impossible to sensibly roll things back like they were before the
connection was opened. Is this possible with the concurrency model you
specified?
The things you're describing are from the time when we were assuming STM
(Software Transactional Memory) would be used by every implementation of
Perl 6. Things have changed a bit in the last months, as STM seems a bit
more challenging then it looks at first sight for a language as complex
as Perl 6, specially if you think about lazyness.
OTOH, the problem POE solves is the lack of a good "green threads"
implementation in perl 5, which I think is not a problem for Perl 6 (I
can say that for sure about SMOP, but I'm pretty sure that is also valid
for parrot).
I agree that's what it solves, although it has many other
capabilities.
What I guess I'm interested in seeing is a consistent threads
interface which as much as possible (and it may not always be possible) can be
used across platforms, whether the backend is OS threads or green threads.
In that specific area of writing network servers, I've been with a fixed
idea about providing autothreading code, so you can write code that
I think you a word out (possibly "I've been [playing] with..."?)
looks like 'imperative block-wait programming', but is actually 'async
non-blocking programming'. I'll paste my last sketch about it here:
POE looks like it does something very similar. It works with any kind
of event loop, though, not just IO. I just discovered POE yesterday, so it
still seems very cool to me; we'll see in another month :).
:)
---------------------------------------------------------------------
| Name: Tim Nelson | Because the Creator is, |
| E-mail: wayl...@wayland.id.au | I am |
---------------------------------------------------------------------
----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V-
PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----