home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!jato!jdickson
- From: jdickson@jato.jpl.nasa.gov (Jeff Dickson)
- Subject: Re: How to program multi-threaded programs on Amiga ?
- Message-ID: <1992Nov9.185443.2011@jato.jpl.nasa.gov>
- Organization: Jet Propulsion Laboratory
- References: <d9hh.720658421@dtek.chalmers.se> <1992Nov3.192244.15235@jato.jpl.nasa.gov> <d9hh.720829520@dtek.chalmers.se>
- Date: Mon, 9 Nov 1992 18:54:43 GMT
- Lines: 54
-
- In article <d9hh.720829520@dtek.chalmers.se> d9hh@dtek.chalmers.se (Henrik Harmsen) writes:
- >jdickson@jato.jpl.nasa.gov (Jeff Dickson) writes:
- >
- >>In article <d9hh.720658421@dtek.chalmers.se> d9hh@dtek.chalmers.se (Henrik Harmsen) writes:
- >>>
- >>>My particular problem is this: I need a process to run concurrently
- >>>with the rest of the program to handle input from the OS. Then,
- >>>when it has some input, it should put it on a buffer and signal
- >>>it's arrival with some kind of semaphore so the consumer-process
- >>>can go and collect it.
- >
- >>When the OS (IDCMP) sends you a message it will append the message to
- >>the message port (UserPort) and set the signal associated with it. To
- >>have a seperate process do this for you wouldn't be necessary. The arri-
- >>val of these messages and the setting of the signal bit are asynchronous.
- >
- >>oThe reason I need this structure is that I want the program to
- >>>be able to cope with a lot of messages from the OS (because
- >>>I need to read mouse-positions all the time) and at the
- >>>same time do some heavy work in the editor without having
- >>>to collect messages all the time.
- >
- >>The messages would collect by themselves. You wouldn't have to explicitly
- >>do this.
- >
- >>jeff
- >
- >Yes, I know, Intuition has a buffer for all the messages that it wants
- >to send me, but when you have a humungous amount of messages this buffer
- >quite easily overflows.
- >
- >I also want to use more than one (two, three..) processes for other things.
- >It would be nice to be able to edit one text while you process another :-)
- >
- >
-
- All the IDCMP messages get sent to your window's UserPort which you
- can presupply so as to avoid Intuition creating one for you. Why not use a
- port that was created by another task/process for this purpose? That way,
- your main process could go about its merry way and not have to worry about
- the IDCMP messages, because Intuition will have sent them to the other task/
- process for handling. Don't ask me if this works - I never tried it. But, it
- ought to. I seriously doubt C= makes this break. If this does work though, the
- C= crew is likely to say it's a hack and may not be tolerated in future oper-
- ating system releases. The VM folks could have a pet peeve as well.
-
- Jeff
-
-
-
-
-
-
-
-