home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / bsd / 11057 < prev    next >
Encoding:
Text File  |  1993-01-08  |  2.4 KB  |  65 lines

  1. Path: sparky!uunet!europa.asd.contel.com!gatech!rpi!uwm.edu!ogicse!pdxgate!jrb@rigel.cs.pdx.edu
  2. From: jrb@rigel.cs.pdx.edu (James Binkley)
  3. Newsgroups: comp.unix.bsd
  4. Subject: setitimer bug revisited/signal question/midi/mpu
  5. Message-ID: <6679@pdxgate.UUCP>
  6. Date: 8 Jan 93 22:59:07 GMT
  7. Article-I.D.: pdxgate.6679
  8. Sender: news@pdxgate.UUCP
  9. Lines: 54
  10.  
  11. I've been trying to figure out why the "real timer" in
  12. setitimer was "unreal"; i.e., you couldn't do better
  13. than 10Hz.  You should be able to.  The real timer
  14. works correctly on BSDI and sun boxes with the code
  15. I posted before. On 386bsd, you could never get
  16. better than 10hz; i.e., 10 interrupts per second.
  17. You should be able to get somewhere up to around 100hz
  18. (but not quite).  I also discovered that the same
  19. thing was true for the other two setitimer timers,
  20. profiling, and virtual (limited to 10hz).  The problem seems to be based
  21. on the fact that code in kern/kern_sig.c/psignal()
  22. has changed (say from 4.2 BSD) 
  23. so that in a lot of circumstances, need_resched() is
  24. *not* called. In the past, I believe any signal would cause
  25. rescheduling to occur. Here it won't occur until the 
  26. round-robin daemon runs at 10 times a second... So to quote
  27. a long departed political leader: "what is to be done?"  
  28.  
  29. As an experiment, I tried blatantly toggling want_resched
  30. like so in realitexpire() in kern/kern_time.c. 
  31.  
  32. /* kern/kern_time.c
  33. */
  34. realitexpire(p)
  35. ...
  36. {
  37.  
  38.     extern int want_resched;
  39.  
  40.     want_resched++;
  41.     psignal(...);
  42.     ...
  43.  
  44. This routine
  45. is called as a timeout routine by setitimer(2) when the
  46. "real timer" is started. The result was the real interval
  47. timer worked correctly.  Here's a possible suggestion
  48. as to one approach (what do other people think?).  I think
  49. psignal should be altered so that when any of the 3 signals
  50. used by setitimer are called, need_resched is called.  I need
  51. to look at the kern/kern_sig.c code a little more.  
  52.  
  53. And now for the midi/mpu part.  I've been working on a "sequencer" --
  54. trying to port it to UNIX from dos.  I have a simple mpu401 driver
  55. if anybody wants it, and I'll get around to getting the sequencer
  56. put out someplace for ftp'ing in a bit.  (It needs some aging
  57. and I've got some curses work to do first).
  58. The cute part was that I just played Bach's Fugue #9 from the Art of the Fugue
  59. on a UNIX box. I've always maintained that music wasn't very real-time.
  60. Of course, I wasn't hooked to a network and wasn't running sendmail
  61. in the background... it worked fine.
  62.  
  63.                 Jim Binkley
  64.                 jrb@cs.pdx.edu
  65.