Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-lcc!rutgers!husc6!mit-eddie!genrad!decvax!ucbvax!RELAY.CS.NET!wick%instr.camosun.bcc.cdn%ubc.CSNET From: wick%instr.camosun.bcc.cdn%ubc.CSNET@RELAY.CS.NET (Darrell Wick) Newsgroups: comp.lang.modula2 Subject: Concurrency & Interrupts Message-ID: <376*wick@instr.camosun.bcc.cdn> Date: Mon, 22-Dec-86 13:51:08 EST Article-I.D.: instr.376*wick Posted: Mon Dec 22 13:51:08 1986 Date-Received: Mon, 22-Dec-86 23:20:12 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 42 HELP: I am having difficulty connecting Concurrent Processes and Coroutines, as presented in Chapter 30 of PIM2, with Device Handling, Concurrency, and Interrupts as presented in Chapter 31. In Chap 30 of PIM2, Concurrent Processes and Coroutines, two modules are presented, Processes and Buffer. Processes provides a mechanism for process synchronization via SIGNAL's. Module Buffer (Dijkstra's "sleeping barber" version) provides process synchronization using buffer.deposit and buffer.fetch from a monitor buffer. In Chap 31, an example PDP-11 keyboard device driver is presented. The buffer concept here does not appear compatible with that in Chap 30. Here the consumer of data from the keyboard driver process must poll the exported variable n (a "read only" variable indicating the number of elements currently within the buffer.) and fetch only when n is positive. This polling seems incompatible with the concept of coroutines and the previous chapter. I would think it would be desireable to integrate the device driver with the Dijkstra buffer, perhaps by replacing the Keyboard.fetch with something like Buffer.fetch (which includes WAIT); but then the driver itself should include the corresponding SEND (an impossible situation, because a transfer would occur without the proper interrupt return). So how does one include coroutines, buffer monitors and device drivers all within one program? Darrell Wick Camosun College, 3100 Foul Bay Rd, Victoria, BC, V8P 4X8 CANADA (604) 592-1281 CSNET: wick%instr.camosun.bcc.cdn@ubc.csnet ARPA: wick%instr.camosun.bcc.cdn%ubc.csnet@csnet-relay.arpa UUCP: wick%instr.camsoun.bcc.cdn@ubc-vision.uucp or ...!ubc-vision!instr.camosun.bcc.cdn!wick BITNET: wick@instr.camosun.bcc.cdn (Columbia/Crosswell mailer) : wick%instr.camosun.bcc.cdn%ubc.mailnet@MIT-Multics.ARPA >>>> END-OF-MESSAGE <<<<