1== Using Ruby Threads with RubyCocoa == 2 3Using Ruby threads to call Objective-C APIs may result in random crashes 4unless the Ruby interpreter has been patched. 5 6For the rationale behind this problem, please read: 7: 8http://lists.sourceforge.jp/mailman/archives/rubycocoa-devel/2006-August/000373.html 9 10We strongly recommend you to patch your version of Ruby if you plan to write 11RubyCocoa threading code. 12 13== Binary == 14 15We provide a binary version of libruby 1.8.2 that have been already patched. 16 17This binary is meant to replace Apple's version of Ruby in Tiger. 18 19Installation is simple: 20 211. Decompress the tarball 22 23 $ tar -xzf misc/libruby.1.dylib-tiger.tar.gz 24 252. Copy the resulted binary to /usr/lib/libruby.1.dylib. Make a backup of the 26 previous version before. 27 28 $ sudo mv /usr/lib/libruby.1.dylib /usr/lib/libruby.1.dylib.old 29 $ sudo mv libruby.1.dylib /usr/lib/libruby.1.dylib 30 31== Manually Patching == 32 33ruby_thread_hooks.diff is the patch that needs to be applied to the Ruby 34interpreter. 35 36The patch can be theoretically applied to any Ruby 1.8.x release (works fine 37with 1.8.6 and even with the latest patchlevel releases). 38 39Versions of Ruby below 1.8.x are not supported. 40 41The patch doesn't need to be applied before building RubyCocoa. 42 43Example: 44 45$ tar -xzf ruby-1.8.x.tar.gz 46$ cd ruby-1.8.x 47$ patch -p0 </path/to/ruby_thread_hooks.diff 48$ ./configure --enable-shared --enable-pthread 49$ make 50$ sudo make install 51