Satoshi Nakagawa
snaka****@infot*****
Thu Jul 5 18:10:47 JST 2007
Hi Laurent. >> I have another question. >> Is calling performSelectorOnMainThread_withObject_waitUntilDone >> safe within a Ruby thread now without the patch? > > Yes, the patch is required to use Ruby threads, but you can still use > APIs dealing with native threads without the patch. I see. I feel assured. > RubyCocoa detects calls from ObjC to Ruby that are done in a different > thread and tries to route the call in the main one, to avoid a crash, > but this isn't optimal. This can for example cause performance > regressions, or even worse, deadlocks (if the main thread is busy). That's a good abstraction. Problems around threading are always complicated. > So I would say that the safest way to do threading with RubyCocoa is > to use the patch and Ruby threads (via the Thread class). It's ok. But I want to support Tiger + ruby 1.8.2 on my application. So I think I should use performSelectorOnMainThread_withObject_waitUntilDone for a while. Thanks for your detailed information. -- Satoshi Nakagawa