Re: Any actor or coroutine implementations for Cocoa?
Re: Any actor or coroutine implementations for Cocoa?
- Subject: Re: Any actor or coroutine implementations for Cocoa?
- From: Marc Schlichte <email@hidden>
- Date: Mon, 28 Jul 2008 00:07:50 +0200
Anyone know if the "Actor" design pattern for concurrent programming
has been implemented for Cocoa?
In a nutshell, an Actor is an object that has its own [cooperative]
thread and message queue. Actors interact by message-passing instead
of shared state. The idea is to eliminate the need for standard
synchronization primitives like semaphors and locks, and get rid of
the race conditions and deadlocks that plague multi-threaded
programs. There's a very good overview on the website for the new
Ruby library Revactor:
http://revactor.org/philosophy
Actors are also built into languages like Erlang and Io.
The only hard part about implementing Actors in Obj-C appears to be
the underlying dependency on coroutines. Steve Dekorte [author of
Io] has a newish coroutine implementation in C that works on OS X.
When I discovered that last year, I then found an Objective-C
wrapper by dPompa, but that relies on his HigherOrderMessaging
library, which is incompatible with 10.5 and hasn't yet been updated.
If nothing's currently available, I'd gladly work together with one
or more other motivated people to get coroutines and/or Actors
working. Anyone else interested?
—Jens
I've started a small Erlang style actor library for Cocoa which uses
property-lists as message format between actors and NSPredicate
objects as message reception patterns. It doesn't use coroutines et
al. to rectify the control flow but uses the event based approach
instead.
The library is called Plankton and is hosted at google code http://code.google.com/p/plankton-platform/
. Anyone is invited to further hack this lib.
Cheers
Marc
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden