On 20 July 2010 18:28, Fabien CELLIER <tall...@users.sourceforge.net> wrote:
> Hello everybody,
>
> I created a small wrapper for actor model in vala (just a poc for a friend,
> in order to show that multithreading could be easy with glib ).
> The code is small and contains, probably, bugs but I won't delete the repo
> before next month, so if someone wants to take a look  (
> http://beta.intuxication.org/hg/tallion/vactors/file/). The main.vala file
> contains a "Hello World"  (vactors run 45% faster on my dual core for big
> pictures)

Indeed an actor model for Vala would be a sweet deal. Perhaps an actor
model could even replace a "mainloop concept" in the Dova profile
(this is just me rambling :-)).

Looking at your code I see two major issues that will prevent you from
scaling into millions of actors:

 * No work stealing
 * The mailboxes are implemented as async queues living on a per-actor basis

A fully scalable actor model needs a work stealing thread pool and for
the task queues to live per-thread in that pool, and not per-actor.
This way you will have extremely low lock contention.

-- 
Cheers,
Mikkel
_______________________________________________
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to