Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!hpsal2!viggy From: viggy@hpsal2.HP.COM (Viggy Mokkarala) Newsgroups: comp.arch Subject: H/W Write Buffers, S/W Synchronization Message-ID: <2280002@hpsal2.HP.COM> Date: Mon, 26-Oct-87 14:28:39 EST Article-I.D.: hpsal2.2280002 Posted: Mon Oct 26 14:28:39 1987 Date-Received: Thu, 29-Oct-87 19:54:45 EST Organization: Hewlett Packard, Cupertino Lines: 52 Hardware Write Buffers and Software Synchronization I have been looking into a problem involving software synchronization using shared variables in tightly coupled private cache multiprocessor systems with hardware write buffers. I would like to hear other people's experiences with the problem: should an architecture allow the performance advantage of write buffers and restrict the way software synchronizes? Hardware write (store) buffers provide queueing to smooth out the total instruction flow by allowing the execution unit to proceed in spite of unpredictable delays caused by the storage unit (cache miss). In a shared memory, private cache (write back) multiprocessor system, a write buffer can cause temporary staleness of data. If such data is being shared between processes that are executing on different processors, as in the example below, there can be serious problems with inconsistencies, or deadlocks. Master Slave Create work; Consume work; Block; Completed++; available++; if (completed < available) if ((available - completed) > 1) wakeup(master); sleep; else sleep; else wakeup (slave); In this example, synchronization is accomplished through modification of shared variables 'available', and 'completed'. Changes to these variables are not instantaneously visible in the other processor modules. This causes caches to become temporarily stale, which causes the problem - both master and slave go to sleep forever. The question is not "how to synchronize with write buffers", but rather the follwoing: 1. How much code already uses this? 2. Is it difficult to write software with such a restriction?, and 3. Would it be appropriate to force software writers to identify shared variables? John Mashey, are you listening? Viggy Mokkarala (hplabs!hpda!viggy) (408)447-5983 19420 Homestead Road, Cupertino, CA 95014.