xref: /plan9/acme/bin/source/acd/outline (revision 9a747e4fd48b9f4522c70c07e8f882a15030f964)
1*9a747e4fSDavid du Colombieracd is composed of four procs
2*9a747e4fSDavid du Colombier
3*9a747e4fSDavid du Colombierwineventproc (win.c:/^wineventproc)
4*9a747e4fSDavid du Colombier	reads acme window events, sends them along w->cevent.
5*9a747e4fSDavid du Colombier
6*9a747e4fSDavid du Colombiercdstatusproc (mmc.c:/^cdstatusproc)
7*9a747e4fSDavid du Colombier	reads cd status once per second, sending
8*9a747e4fSDavid du Colombier		status updates to d->cstatus.
9*9a747e4fSDavid du Colombier	detects disk changes, sends new tocs to d->ctocdisp.
10*9a747e4fSDavid du Colombier
11*9a747e4fSDavid du Colombiercddbproc (cddb.c:/^cddbproc)
12*9a747e4fSDavid du Colombier	reads tocs from d->cdbreq, if it finds
13*9a747e4fSDavid du Colombier		translations in the cddb, sends new tocs to d->cdbreply.
14*9a747e4fSDavid du Colombier
15*9a747e4fSDavid du Colombiereventwatcher (main.c:/^eventwatcher)
16*9a747e4fSDavid du Colombier	the main event loop.
17*9a747e4fSDavid du Colombier		reads status from d->cstatus.
18*9a747e4fSDavid du Colombier		reads events from w->cevent.
19*9a747e4fSDavid du Colombier		reads new tocs to display from d->ctocdisp.
20*9a747e4fSDavid du Colombier		sends new tocs to translate to d->cdbreq.
21*9a747e4fSDavid du Colombier		reads new translated tocs from d->cdbreply.
22*9a747e4fSDavid du Colombier
23*9a747e4fSDavid du Colombieran interesting bug in the original design:
24*9a747e4fSDavid du Colombier	both cdstatusproc and the eventwatcher proc
25*9a747e4fSDavid du Colombier	issue scsi commands.  (the eventwatcher responds to
26*9a747e4fSDavid du Colombier	things such as Play, Stop, etc., as well as advancing the track.)
27*9a747e4fSDavid du Colombier
28*9a747e4fSDavid du Colombier	the sd(3) driver did not expect overlapped commands,
29*9a747e4fSDavid du Colombier	and crashed.
30*9a747e4fSDavid du Colombier
31*9a747e4fSDavid du Colombier	this has been fixed by making the scsi(2) commands threadsafe,
32*9a747e4fSDavid du Colombier	and making the sd(3) driver more robust.
33