From: Ashikali Ashikali Date: 2009-08-12T21:29:02+09:00 Subject: Re: ruby thread is buggy while using serialport geidies@googlemail.com wrote: > On Aug 12, 6:40�am, Ashikali Ashikali wrote: >> > 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. I have to inform you another problem . Al though I am using Thread for one serial port let us say /dev/ttyPS0 . It is blocking another serial devive /dev/ttyPS2 . I could not understand why thread is blocking another serial device too while using serialport library . Please go through the attached source code . For your reference . Attachments: http://www.ruby-forum.com/attachment/3947/modemThread.rb -- Posted via http://www.ruby-forum.com/.