Number: 166 Date: 18-Mar-84 15':41':23 Submitter: Sannella.PA Source: stansbury.pa Subject: Want Monitor Locks just by marking resource Assigned To: Attn: vanMelle.pa Status: Open In/By: Problem Type: Design - Impl Impact: Annoying Difficulty: Hard Frequency: Everytime Priority: Unlikely System: Operating System Subsystem: Processes Machine: Disk: Lisp Version: Source Files: Microcode Version: Memory Size: File Server: Server Software Version: Disposition: Description: ' Date': 17 Mar 84 17':44 PST' From': stansbury.pa' Subject': Lisp': Language': Monitor Locks' To': LispSupport.pa' cc': vanMelle' Lisp-System-Date': 15-Mar-84 00':13':18' Machine-Type': Dorado' ' If I understand monitor locks correctly, if you want to protect some global resource from simultaneous access by competing processes, you have to wrap each piece of code which uses the global resource in a with.monitor.' ' This strikes me as the wrong way round': it would seem much safer if you could mark the resource once, rather than mark each piece of code that uses it.' ' -- Tayloe.' ' -----' ' Date': 9 Apr 84 14':20 PST' From': vanMelle.pa' Subject': Re': AR#166': Monitor Locks by marking resource' To': LispSupport, Stansbury' cc': vanMelle.pa' ' Unlikely/Hard' ' Languages I know of that associate a monitor with a structure (e.g., Mesa''s Monitor Records) have the benefit of a compiler to know where the accesses are and implicitly wrap monitor lock contexts around them.' ' In Lisp''s case, one has to rely a little more on programmer discipline. You say "it would seem much safer if you could mark the resource once, rather than mark each piece of code that uses it". True, but "uses it" is a little vague. You need to require that all accesses to it go through some stylized construct that enforces the monitor. No reason you can''t hide that with macros or accessfns, of course. But this turns out to be pretty much equivalent to "you have to wrap each piece of code which uses the global resource in a with.monitor". And the with.monitor around the entire chunk of code is probably going to be a lot more efficient than putting one on each access.' ' Another comment is that protecting a shared resource typically involves more than just the explicit accesses to a data structure.' ' Bill' Workaround: Test Case: Edit-By: vanMelle Edit-Date: 7-Jun-84 15':47':42