Folks,
I love the Erlang multi-processing experience and think that a lot of
the mistakes that I made could be avoided. What I want to have is
1) Processes, aka threads with single-slot in/out mailboxes
2) A facility to keep a list of such processes and send events to
them using their process id
3) A socket reader/writer abstraction that communicates with the
outside world using using its mailboxes
Probably some other things but I would start with the above. I also
want to use STM for this.
One particular thing that bugs me is that I cannot really use TChan
for thread mailboxes. I don't think I experienced this problem with
Erlang but using a TChan with a logger thread quickly overwhelms the
logger and fills the TChan and a lot (hundreds? thousands) of other
threads are logging to it. Someone said it's because the scheduler
would give ther other threads proportionally more attention.
I found single-slot mailboxes (TMVar) to work much better as they
pace the overall message flow. Using them means that asynchronous
messages cannot be implemented, though.
Please correct me if I'm wrong. I'll update my blog as I move forward.
Thanks, Joel
--
http://wagerlabs.com/
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe