title: How can one Tcl thread cause an event in another?
body: <p>I have a system with multiple I/O interfaces, and I'm collecting the output of all of them into a common log.  Two of the interfaces are through well-behaved channels that are opened as file-like objects, and can be managed on an event basis with "fileevent readable".  The other two are the problem.</p>
  
  <p>These are to a vendor-supplied library, which someone else has already kindly wrapped into a Tcl package (snoopy, FWIW).  However, the only read access is a blocking call, and there's nothing in the package that would cause an event equivalent to a fileevent.</p>
  
  <p>I've figured out how to spawn a separate thread to block on the read, pull the result, and put it into a message queue for the main thread.  But having the main thread block on reading the queue would seem to defeat the purpose, especially since there are two queues it would have to block on.  And I haven't been able to get the reader to generate an event that can trigger the main thread to read the queue.  </p>
  
  <p>I've looked on the tcl.tk wiki to no avail so far.  I've tried using the uevent library to generate an event on a message push, but the event goes to the writing thread instead of the reading thread, which really doesn't help.  It seems like there should be some solution related to a Thread condition variable, but so far I haven't been able to find an appropriate design pattern for that use of the library.</p>
  
  <p>If all else fails I'll fall back to a Tk event, but I'm trying to keep Tk out of this as it's meant to be an automated system with no GUI, and any mention of Tk pushes tclsh into wish and pops up a GUI window.  </p>
  
  <p>I feel like I'm close, but just missing something.</p>