home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.14 / text0042.txt < prev    next >
Encoding:
Internet Message Format  |  1989-01-07  |  1.2 KB

  1. From: uunet!sugar!peter (Peter da Silva)
  2.  
  3.  
  4. What sorts of approaches have people taken to doing real-time control under
  5. UNIX? How far apart are the different standards?
  6.  
  7. [ There is no standard yet that I know of.  IEEE 1003.4 is working on one,
  8. and there is also the /usr/group Technical Committee Working Group on Realtime.
  9. There will be some comments on them in Shane's next report, which we should
  10. see shortly.  -mod ]
  11.  
  12. [I have this fantasy of one day being able to write a program that does
  13.  something like this under UNIX:
  14.  
  15.  comm=open("/dev/tty3a", 2);
  16.  status=open("/dev/tty3b", 2);
  17.  
  18.  memory=open("/usr/scada/mempool", 2);
  19.  
  20.  mempool=map_file(memory, POOLSIZE);
  21.  
  22.  commbit = 1 << (commflag = async_read(comm, commbuf, 1));
  23.  statbit = 1 << (statflag = async_read(status, statbuf, 1));
  24.  
  25.  bits = commbit|statbit;
  26.  while(bits) {
  27.   flags = async_wait(bits);
  28.   if(flags&commbit) {
  29.    bits &= ~commbit;
  30.    do something with *commbuf;
  31.    repost read if necessary;
  32.   }
  33.   if(flags&statbit) {
  34.    bits &= ~statbit;
  35.    do something with *statbuf;
  36.    repost read if necessary;
  37.   }
  38.  }
  39. ]
  40. -- 
  41.         Peter da Silva  `-_-'  peter@sugar.uu.net
  42.          Have you hugged  U  your wolf today?
  43.  
  44.  
  45. Volume-Number: Volume 14, Number 44
  46.  
  47.