home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / realtime / 1636 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  1.8 KB

  1. Path: sparky!uunet!ukma!darwin.sura.net!udel!intercon!digex.com!digex.com!not-for-mail
  2. From: realtime@access.digex.com (REAL TIME Corporation)
  3. Newsgroups: comp.realtime
  4. Subject: Re: PSOS+ Timers
  5. Date: 27 Jan 1993 16:50:30 -0500
  6. Organization: Express Access Online Communications, Greenbelt, MD USA
  7. Lines: 42
  8. Message-ID: <1k7036INNmg8@digex.digex.com>
  9. References: <1993Jan15.150848.3327@mprgate.mpr.ca>
  10. NNTP-Posting-Host: access.digex.com
  11.  
  12. >References: <1993Jan15.150848.3327@mprgate.mpr.ca>
  13. >Randy Chapman writes:
  14.  
  15. >Has anybody implemented a timer class in C++ for PSOS+
  16. >whereby you can create a timer(s) with a callback upon expiry?
  17. >Implementations is C would help as well.
  18.  
  19. Here are some solutions to your question:
  20.  
  21. 1. Use PSOS+ service TM_EVAFTER (Ticks, Events; TNid= )
  22.   
  23.    This will send an event to the calling task after the specified
  24.    time. The task is not blocked, and continues execution.
  25.    Some time after the call, the task will have to call 
  26.    PSOS+ again, to see if the event has been posted, or the
  27.    task can wait for the event.
  28.  
  29. 2. Use PSOS+ service TM_EVWHEN ( Date, Time, Ticks, Events; TMid=)
  30.    
  31.    This will send an event to the calling task at the appointed time.
  32.    Similar to #1 above.
  33.  
  34. 3. Use TM_EVERY ( Ticks, Events; Tmid= )
  35.  
  36.    This will send an event to the calling task at periodic intervals.
  37.    Depending on the application, this might not be what you want.
  38.    For example: If Ticks=3 and the calling task checks for the event
  39.    flag after 10 ticks, the event will be there, but the task will
  40.    not know that the event was posted 3 times. (at +3 ticks, +6 ticks,
  41.    +9 ticks).
  42.  
  43. 4. If you need to know how many times the timer expired, you need
  44.    to use PSOS+ messages deposited into a queue.  This requires
  45.    some programming effort.
  46.  
  47. If you need more details, please e_mail.
  48.  
  49. Naomi Avigdor
  50. REAL TIME Corporation
  51.  
  52. realtime@digex.com
  53.  
  54.