From: Matias P. B. <mat...@gm...> - 2008-03-16 01:05:53
|
Thanks ... On Fri, Mar 14, 2008 at 2:01 AM, Eloy Duran <e....@su...> wrote: > Hi Matias, > > I would suggest first looking at classes in cocoa which most of the > times do things like firing notifications > which are much easier to work with that threads. For instance > NSURLRequest. > > Eloy > > > On Mar 14, 2008, at 1:25 AM, Laurent Sansonetti wrote: > > > Hi Matias, > > > > On Thu, Mar 13, 2008 at 4:31 PM, Matias Pablo Brutti > > <mat...@gm...> wrote: > >> Hi , > >> > >> I've read that rubycocoa has some issues with threads , NSThreads, > >> which > >> will be the best approach to take to actually use threads?, which > >> type of > >> threads should I use and finally is there an example or doc on > >> rubycocoa > >> threads that you recommend ?, > >> > >> I'm implementing an application that makes lots of requests which > >> takes some > >> time. My idea is to thread that process and while I receiving he > >> info update > >> the TableView, all this while not frezzing my main application but > >> without > >> threads I do not see how to do that. any ideas ? > >> > > > > The current version of Ruby (1.8) not being thread-safe, it is > > currently impossible to use NSThreads. Well you can, but RubyCocoa > > will route calls into the main thread for you (to avoid crashing), and > > it might cause a deadlock sometimes. > > > > The preferable way is to use Ruby threads instead. In Leopard, both > > the interpreter and RubyCocoa were modified to support calling > > Objective-C from Ruby threads. But this support is not ideal (you can > > see that as a hack), and sometimes it doesn't work. > > > > You can also use NSTimers or any other mechanism driven by the Cocoa > > runloop. > > > > HTH, > > Laurent > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > Rubycocoa-talk mailing list > > Rub...@li... > > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > -- -- --<自由編碼人>-- Ing. Matias Pablo Brutti Security Consultant Email : mat...@gm... Site: http://www.freedomcoder.com.ar |