[MacRuby-devel] concurrent calling into macruby

Jordan K. Hubbard jkh at apple.com
Thu Jan 6 14:57:08 PST 2011


On Jan 6, 2011, at 2:48 PM, Laurent Sansonetti wrote:

> Yes, MacRuby is fully re-entrant and multi-threaded. The GC also runs on its own threads and will allocate/collect memory from them. There shouldn't be any problem, assuming you are careful not trying to run into the same object from different threads.  Unlike the traditional Ruby implementation, there is no global lock to prevent race conditions.

... and, of course, since MacRuby supports GCD, the appropriate thing to do is simply tie each potentially contended object to its own GCD queue and use the async setter / sync getter pattern to make sure that everything works the way you expect!

- Jordan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20110106/598c843a/attachment.html>


More information about the MacRuby-devel mailing list