home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / amiga / programm / 15616 < prev    next >
Encoding:
Text File  |  1992-11-09  |  2.7 KB  |  65 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!jato!jdickson
  3. From: jdickson@jato.jpl.nasa.gov (Jeff Dickson)
  4. Subject: Re: How to program multi-threaded programs on Amiga ?
  5. Message-ID: <1992Nov9.185443.2011@jato.jpl.nasa.gov>
  6. Organization: Jet Propulsion Laboratory
  7. References: <d9hh.720658421@dtek.chalmers.se> <1992Nov3.192244.15235@jato.jpl.nasa.gov> <d9hh.720829520@dtek.chalmers.se>
  8. Date: Mon, 9 Nov 1992 18:54:43 GMT
  9. Lines: 54
  10.  
  11. In article <d9hh.720829520@dtek.chalmers.se> d9hh@dtek.chalmers.se (Henrik Harmsen) writes:
  12. >jdickson@jato.jpl.nasa.gov (Jeff Dickson) writes:
  13. >
  14. >>In article <d9hh.720658421@dtek.chalmers.se> d9hh@dtek.chalmers.se (Henrik Harmsen) writes:
  15. >>>
  16. >>>My particular problem is this: I need a process to run concurrently
  17. >>>with the rest of the program to handle input from the OS. Then,
  18. >>>when it has some input, it should put it on a buffer and signal
  19. >>>it's arrival with some kind of semaphore so the consumer-process
  20. >>>can go and collect it.
  21. >
  22. >>When the OS (IDCMP) sends you a message it will append the message to
  23. >>the message port (UserPort) and set the signal associated with it. To 
  24. >>have a seperate process do this for you wouldn't be necessary. The arri-
  25. >>val of these messages and the setting of the signal bit are asynchronous. 
  26. >
  27. >>oThe reason I need this structure is that I want the program to
  28. >>>be able to cope with a lot of messages from the OS (because
  29. >>>I need to read mouse-positions all the time) and at the
  30. >>>same time do some heavy work in the editor without having
  31. >>>to collect messages all the time.
  32. >
  33. >>The messages would collect by themselves. You wouldn't have to explicitly
  34. >>do this. 
  35. >
  36. >>jeff
  37. >
  38. >Yes, I know, Intuition has a buffer for all the messages that it wants
  39. >to send me, but when you have a humungous amount of messages this buffer
  40. >quite easily overflows.
  41. >
  42. >I also want to use more than one (two, three..) processes for other things.
  43. >It would be nice to be able to edit one text while you process another :-)
  44. >
  45. >
  46.  
  47.     All the IDCMP messages get sent to your window's UserPort which you 
  48. can presupply so as to avoid Intuition creating one for you. Why not use a
  49. port that was created by another task/process for this purpose? That way,
  50. your main process could go about its merry way and not have to worry about
  51. the IDCMP messages, because Intuition will have sent them to the other task/
  52. process for handling. Don't ask me if this works - I never tried it. But, it
  53. ought to. I seriously doubt C= makes this break. If this does work though, the
  54. C= crew is likely to say it's a hack and may not be tolerated in future oper-
  55. ating system releases. The VM folks could have a pet peeve as well.
  56.  
  57. Jeff
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.