Asterix Gallier wrote:
> 
> Your solution by using a file descriptor sounds very interesting. I've 
> searched but didn't find any adequate example or documentation beside 
> the ruby source itself.
> 
> Can you please give me any support for this approach.
> 
> As far as i can see, i need to simulate a file filedescriptor to ruby. 
> Am I right? I've got no idea how to do this. I take a look at the 
> ruby-serialport source but i think that this is not applicable to my 
> situation or?

Asterix, I don't have time right this moment to write and test a working 
code sample, but you can try using Ruby's IO.pipe to get a pair of 
descriptors connected to each other.

rd,wr = IO.pipe
writeable_descriptor = wr.fileno

Now your Windows thread can write the writeable_descriptor and your Ruby 
thread can select([rd]).

Hope that helps. There are probably pitfalls with this approach on 
Windows. I know I've done this before or something like it, but will 
need a bit of time to find the code.

-- 
Posted via http://www.ruby-forum.com/.