Green threads

9 views
Skip to first unread message

Nadav Wiener

unread,
Apr 11, 2009, 8:22:27 PM4/11/09
to actorom-discussions
Hi Sergio,
I've been playing around with Google App Engine's recent Java support.
They are pretty restrictive -- you can't spawn new threads (new Thread
() isn't permitted by their security manager).

The restrictions make lots sense in terms of billing and performance
management, but since they already limit CPU time, I see no harm to
them in trying to regain some limited concurrency within the local
scope of a single request, if just for the fun of it :)

That's how I came by your library -- searched Twitter for "green
threads".
I tried to deploy a modified pingpong-with-local-actors sample in GAE
SDK's local server, but ran against GreenMessageDispatcher, trying to
create a new selector thread.

My question: since the selector thread is essentially a "main loop",
would it make any sense to pull its functionality to the main thread?
that is, create a topology, spawn actors, but defer the OnSpawn event
handling to when the main loop starts up.

This way, a single request to a GAE application can spin up lots of
actors for a short duration.

Does this make any sense?

Thanks,
-Nadav.

Sergio Bossa

unread,
Apr 12, 2009, 8:55:17 AM4/12/09
to actorom-d...@googlegroups.com
On Sun, Apr 12, 2009 at 2:22 AM, Nadav Wiener <nadav....@gmail.com> wrote:

> I tried to deploy a modified pingpong-with-local-actors sample in GAE
> SDK's local server, but ran against GreenMessageDispatcher, trying to
> create a new selector thread.

The selector thread is needed because it blocks waiting on the MessageQueue.
In order to use the the main thread, we should use some kind of event
listener, avoiding to wait and block everything.
What do you think?
I'll take a look: in the meantime, any contribution would be very welcome :)

Cheers,

Sergio B.

--
Sergio Bossa
Software Passionate and Open Source Enthusiast.
Blog : http://sbtourist.blogspot.com
Pro-Netics : http://www.pronetics.it
Sourcesense : http://www.sourcesense.com

Reply all
Reply to author
Forward
0 new messages