From: "geidies@..." Date: 2009-08-12T18:40:11+09:00 Subject: Re: ruby thread is buggy while using serialport On Aug 12, 6:40 am, Ashikali Ashikali wrote: > Roger Pack wrote: > > >> "before"=> # > >> < blocked> > > > My guess is that serialport library has no way of knowing if it has any > > data incoming [it has to poll until data arrives?] > > If that's the case, then you might could use fork plus some of the > > excellent fork libraries available > >http://allgems.ruby-forum.com/gems?search=forkor you'd need to "fix" > > serialport so that it's 1.9 compatible, and then wrap its read call in > > an rb_thread_blocking_region, so that it allows other threads to > > operate. > > GL. > > -r > > No I am using frok only . It is working fine no problem . > > Also while traping simultaneous SIGCLD also it does not working properly You are passing in the same object to different threads. So the threads call methods on the same object. Try creating a SerialPort.new inside the thread. With fork, you generate a seperate ruby process with seperate objects.