<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=953023923-21012007><FONT face=Arial size=2>Hello, I'm new in 
this list and I apologize in advance if my questions are too 
basic.</FONT></SPAN></DIV>
<DIV><SPAN class=953023923-21012007><FONT face=Arial size=2>I'm writing an 
application which "talks" with a number of test devices connected to a gpib card 
and I'm using for this the open source linux gpib driver (<A 
href="http://linux-gpib.sourceforge.net">http://linux-gpib.sourceforge.net</A>).</FONT></SPAN></DIV>
<DIV><SPAN class=953023923-21012007><FONT face=Arial size=2>This is a 
multithread application, each thread for each device as each device has it's own 
device descriptor to read from and write to it.</FONT></SPAN></DIV>
<DIV><SPAN class=953023923-21012007><FONT face=Arial size=2>Within various 
states of the state machine of each thread, I need to implement a look, sending 
a query to the device for it's current state and reading the 
response.</FONT></SPAN></DIV>
<DIV><SPAN class=953023923-21012007><FONT face=Arial size=2>The loop may end in 
2 ways: either the device has transitioned to a new state or timeout has occured 
and no transition happened during this time.</FONT></SPAN></DIV>
<DIV><SPAN class=953023923-21012007><FONT face=Arial size=2>Those timers are my 
problem here. The timers may vary within a thread, depending on the expected 
state and, each thread has to have it's own timers independent of the other 
threads.</FONT></SPAN></DIV>
<DIV><SPAN class=953023923-21012007><FONT face=Arial size=2>I cannot implement 
this by using alarm, setitimer and getitimer as they are process wide and not 
thread safe.</FONT></SPAN></DIV>
<DIV><SPAN class=953023923-21012007><FONT face=Arial size=2>So I wonder if 
libevent may be the appropriate tool to help me implement those 
timers.</FONT></SPAN></DIV>
<DIV><SPAN class=953023923-21012007><FONT face=Arial size=2>If indeed, then how 
should I use it and which functions are relevant for this 
case?</FONT></SPAN></DIV>
<DIV><SPAN class=953023923-21012007><FONT face=Arial size=2>I'll continue to 
investigate this by myself, but any assistance I can get from the list members 
will be most appreciated.</FONT></SPAN></DIV>
<DIV><SPAN class=953023923-21012007><FONT face=Arial size=2>Thanks in advance, 
and sorry for the lengthy and detailed message.</FONT></SPAN></DIV>
<DIV><SPAN class=953023923-21012007><FONT face=Arial size=2>Regards, 
Rafi.</FONT></SPAN></DIV></BODY></HTML>