From: benjohn@... Date: 2007-01-04T21:22:30+09:00 Subject: Re: Ruby Cocoa Run Loop Spooq: > On 1/3/07, Benjohn Barnes wrote: >> I'd like to be able to fire up the NSApplication's run loop from >> within a new NSThread. > > I can't comment on any Mac-specific code, but in my experience mixing > threading/event models rarely works. Things like select() get > confused. I've realised two things. First, I don't know what's going on - I'm reading the big Cocoa Programming book by Scott Anguish et al, and it's helping. There's lots about the cocoa / objective c run time interface at the back. I presume this is how the Ruby Cocoa bridge works. Anyway, it's interesting, and perhaps it'll help. I suspect that at least one problem is that the Ruby interpreter is unlikely to be thread safe and re-entrant. Perhaps it is, I don't know. Second, starting a thread is just one approach. What I'm after is a minimal way of: * Getting the application loop going while also * Continuing to have IRB interaction. So I'll keep on working on that :) Cheers, Benjohn