<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1187">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.0px; font: 12.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 12.0px; font: 16.0px Times; color: #011892}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px Helvetica}
p.p6 {margin: 0.0px 0.0px 0.0px 12.0px; font: 16.0px Times; color: #011892; min-height: 19.0px}
span.s1 {direction: ltr; unicode-bidi: embed}
span.s2 {text-decoration: underline ; direction: ltr; unicode-bidi: embed}
span.s3 {text-decoration: underline}
</style>
</head>
<body>
<p class="p1">On 2013-06-24 09:30:47 +0000, Alessandro Sivieri said:</p>
<p class="p2"><br></p>
<p class="p3">Well, the asynchronous function of the library that I want to use actually uses select() in its implementation... so in a way it is already doing what I usually do with driver_select().</p>
<p class="p4"><br></p>
<p class="p5">The driver_select() descriptor is necessary to notify the VM of async events.<span class="Apple-converted-space">  </span>Simplified the VM uses the filedescriptor in a big select or poll call together with all other drivers its waiting on.</p>
<p class="p4"><br></p>
<p class="p5">If you can't use your library without doing its internal select() you need to run it in a separate thread like Max said and create a pipe to get a filedescriptor being passed in driver_select.</p>
<p class="p4"><br></p>
<p class="p5">You then can write a byte to the other end of the pipe from your asyncrously running library to signal that you want your ready_{input,output} callback called to process the event.</p>
<p class="p4"><br></p>
<p class="p5">AFAIK there is no other way to signal events to the VM from an separately running thread.<span class="Apple-converted-space"> </span></p>
<p class="p4"><br></p>
<p class="p5">Cheers,</p>
<p class="p5">-- Peer</p>
<p class="p4"><br></p>
<p class="p3">On Mon, Jun 24, 2013 at 5:43 AM, Max Lapshin <span class="s1"><<a href="mailto:max.lapshin@gmail.com"><span class="s2">max.lapshin@gmail.com</span></a>></span> wrote:</p>
<p class="p3">It is good if you can find some file descriptor that is responsible for your hardware events.</p>
<p class="p3">If no then launch it in separate thread</p>
<p class="p6"><br></p>
<p class="p6"><br></p>
<p class="p6"><br></p>
<p class="p3">--<span class="Apple-converted-space"> </span></p>
<p class="p3">Sivieri Alessandro</p>
<p class="p3"><span class="s3"><a href="mailto:alessandro.sivieri@gmail.com">alessandro.sivieri@gmail.com</a></span></p>
<p class="p3"><span class="s3"><a href="http://sivieri.wordpress.com/">http://sivieri.wordpress.com/</a></span></p>
<p class="p4"><br></p>
</body>
</html>