win32utils-devel@rubyforge.org
2004-Dec-13 00:42 UTC
[Win32utils-devel] win32-thread experiment
Hi all, I''ve checked in some semi-working code into CVS for win32-thread. I don''t really expect this to ever work properly, given that the Ruby interpreter itself isn''t thread safe, but I thought it was fun to tinker. Anyway, with that in mind, give the following a shot: require "win32/thread" t = Win32::Thread.new{ puts "hello" sleep 2 } puts "Done" sleep 1 t.join That should work. But, if more than one thread gets involved you''ll likely see errors. Feel free to tinker. :) - Dan
win32utils-devel@rubyforge.org
2004-Dec-17 01:57 UTC
[Win32utils-devel] win32-thread experiment
Hi Dan, On Fri, 17 Dec 2004 00:22:19 +0900, Daniel Berger wrote:> I''ve tried tinkering with rb_gc_disable() and rb_gc_start() in various > places in the code but I haven''t had any luck. I''m still getting > segfaults. > > Feel free to join the win32utils-devel mailing list. I''d be happy to > hear any ideas you have. :)Actually, I have joined the win32utils-devel mailing list. I gave you a little help with converting FILE* to fileno or to HANDLE back in November :) On the threading, what if you call rb_gc_disable(), then create some win32 threads and see if you still get segfaults? (Don''t ever call rb_gc_start). Of course, if the threads are doing much with Ruby objects they''ll be creating garbage, so at some point the process will run out of memory due to the lack of GC. This is just an experiment to see if threads can run happily if GC is off. If so, we can try to figure out where to go from here. Wayne
win32utils-devel@rubyforge.org
2005-Jan-03 09:15 UTC
[Win32utils-devel] win32-thread experiment
> Hi Dan,Hi, I''m back from vacation. :)> On Fri, 17 Dec 2004 00:22:19 +0900, Daniel Berger wrote: > > I''ve tried tinkering with rb_gc_disable() and rb_gc_start() > in various > > places in the code but I haven''t had any luck. I''m still getting > > segfaults.<snip>> On the threading, what if you call rb_gc_disable(), then > create some win32 threads and see if you still get segfaults? > (Don''t ever call rb_gc_start).I played around with this without luck. Did you have any?> Of course, if the threads are doing much with Ruby objects > they''ll be creating garbage, so at some point the process > will run out of memory due to the lack of GC. This is just > an experiment to see if threads can run happily if GC is off. > If so, we can try to figure out where to go from here. > > WayneIf you have any suggestions, I''m all ears. Also note that I''ve got a highly experimental version of win32-fiber checked into CVS. :) Regards, Dan
win32utils-devel@rubyforge.org
2005-Jan-04 02:01 UTC
[Win32utils-devel] win32-thread experiment
Hi Dan,> I played around with this without luck. Did you have any?I haven''t had time to give it a try myself. Unfortunately, from your results it sounds like more than just the GC is causing problems. Actually, that''s doubly unfortunate, as the GC is one of the few aspects of the environment that we can turn on and off when we want to. Take care, Wayne On Mon, 3 Jan 2005 08:17:04 -0600, win32utils-devel@rubyforge.org <win32utils-devel@rubyforge.org> wrote:> > Hi Dan, > > Hi, I''m back from vacation. :) > > > On Fri, 17 Dec 2004 00:22:19 +0900, Daniel Berger wrote: > > > I''ve tried tinkering with rb_gc_disable() and rb_gc_start() > > in various > > > places in the code but I haven''t had any luck. I''m still getting > > > segfaults. > > <snip> > > > On the threading, what if you call rb_gc_disable(), then > > create some win32 threads and see if you still get segfaults? > > (Don''t ever call rb_gc_start). > > I played around with this without luck. Did you have any? > > > Of course, if the threads are doing much with Ruby objects > > they''ll be creating garbage, so at some point the process > > will run out of memory due to the lack of GC. This is just > > an experiment to see if threads can run happily if GC is off. > > If so, we can try to figure out where to go from here. > > > > Wayne > > If you have any suggestions, I''m all ears. Also note that I''ve got a > highly experimental version of win32-fiber checked into CVS. :) > > Regards, > > Dan > > _______________________________________________ > win32utils-devel mailing list > win32utils-devel@rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel >