[macruby-changes] [3604] MacRuby/trunk/lib/dispatch/README.rdoc
source_changes at macosforge.org
source_changes at macosforge.org
Wed Feb 24 14:14:39 PST 2010
Revision: 3604
http://trac.macosforge.org/projects/ruby/changeset/3604
Author: ernest.prabhakar at gmail.com
Date: 2010-02-24 14:14:38 -0800 (Wed, 24 Feb 2010)
Log Message:
-----------
Dispatch README.rdoc typos
Modified Paths:
--------------
MacRuby/trunk/lib/dispatch/README.rdoc
Modified: MacRuby/trunk/lib/dispatch/README.rdoc
===================================================================
--- MacRuby/trunk/lib/dispatch/README.rdoc 2010-02-24 21:24:03 UTC (rev 3603)
+++ MacRuby/trunk/lib/dispatch/README.rdoc 2010-02-24 22:14:38 UTC (rev 3604)
@@ -94,7 +94,7 @@
In MacRuby, every thread has its own Virtual Machine, which means all of them can access Ruby objects at the same time -- great for concurrency, not so great for data integrity. Fortunately, GCD provides _serial queues_ for {lock-free synchronization}[http://en.wikipedia.org/wiki/Non-blocking_synchronization], by ensuring that only one thread a time accesses a particular object -- without the complexity and inefficiency of locking. Here we will focus on +Dispatch::Proxy+, a high-level construct that implements the {Actor model}[http://en.wikipedia.org/wiki/Actor_model] by wrapping any arbitrary Ruby object with a +SimpleDelegate+ that only allows execution of one method at a time (i.e., serializes data access on to a private queue).
-=== Job#sync Creating Proxies
+=== Job#synchronize: Creating Proxies
The easiest way to create a Proxy is to first create an empty Job:
@@ -129,7 +129,7 @@
@hash.inspect { |s| p s } # => {64 => 1.0E32, 100 => 1.0E50}
-=== __value__: Returning Delegate
+=== \_\_value\_\_: Returning Delegate
If for any reason you need to retrieve the delegate object, simply call +__value__+:
@@ -245,6 +245,9 @@
(0..4).p_findall(3) { |i| i.odd?} # => 3
+---
+= UNDER CONSTRUCTION =
+
== Events
In addition to scheduling blocks directly, GCD makes it easy to run a block in response to various system events, including:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100224/cc1ffe58/attachment.html>
More information about the macruby-changes
mailing list