[comp.lang.modula2] Concurrency & Interrupts

wick%instr.camosun.bcc.cdn%ubc.CSNET@RELAY.CS.NET (Darrell Wick) (12/22/86)

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 <<<<