[Rubycocoa-devel 1057] Re: Ruby Thread with RubyCocoa

Back to archive index

Laurent Sansonetti lsans****@apple*****
Tue Jul 3 23:12:17 JST 2007


This threading support is new and I'm still working on it.

This exception is to warn users that using Ruby threads with RubyCocoa  
code inside (calls to ObjC) will crash if the Ruby interpreter has not  
been patched. Maybe this should just be a warning and not an  
exception, since you could potentially just do pure Ruby stuff inside  
the threads.

Using performSelectorOnMainThread_withObject_waitUntilDone with  
RubyCocoa is a bit useless because RubyCocoa will always use one  
thread (because Ruby is not thread safe). If you detach a new NSThread  
from RubyCocoa, RubyCocoa will forward all calls to the main thread  
indirectly.

Laurent

On Jul 3, 2007, at 3:59 PM, Satoshi Nakagawa wrote:

> Hi.
>
> I saw an error message, when I use Ruby threads on trunk, Tiger.
>
>  RuntimeError: Ruby threads cannot be used in RubyCocoa without  
> patches to the Ruby
>
> Could you allow me to use Ruby threads on the default ruby  
> interpreter 1.8.2 of Tiger?
>
> In my application, I use  
> performSelectorOnMainThread_withObject_waitUntilDone
> to communicate with the main thread from the other threads.
> I think it's a common manner in writing GUI applications.
> It works good even on ruby 1.8.2 of Tiger.
>
> I want to distribute my software to people using Tiger and the  
> default ruby 1.8.2.
> Could you enable the threading patch only if the default interpreter
> on the system supports the patch?
>
> --
> Satoshi Nakagawa
>
> _______________________________________________
> Rubycocoa-devel mailing list
> Rubyc****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/rubycocoa-devel




More information about the Rubycocoa-devel mailing list
Back to archive index