[54] METHOD AND APPARATUS FOR SERIALIZING ACCESS TO MULTITHREADING UNSAFE RESOURCES
[75] Inventors: Andrew E. Davidson, Boulder Creek, Calif.; Maurice Balick, Fairhaven, Md.; Alan Snyder, Palo Alto, Calif.
[73] Assignee: Sun Microsystems, Inc., Mountain
View, Calif.
[21] Appl. No.: 494,117
[22] Filed: Jun. 9,1995
[51] Int Cl.s G06F 15/16
[52] U.S. CI 395/676; 395/670; 395/677;
395/472
[58] Field of Search 395/700, 650,
395/670, 676, 677; 364/DIG. 1
[56] References Cited
U.S. PATENT DOCUMENTS
5,481,706 1/1996 Peek 395/650
5,485,626 1/1996 Lawloretal 395/650
OTHER PUBLICATIONS
Dorfman, and Neuberger, "Effective Multi threading in OS/2®", McGraw-Hill, 1994, USA.
An improved technique for serializing access to multithreading unsafe resources is described. A baton manager is used to manage the serializing of accesses to a multithreading unsafe resource. For a thread to access the multithreading unsafe resource, the thread must first obtain a baton from the baton manager. Then, once the thread has finished accessing the multithreading unsafe resource, the thread releases the baton to the baton manager. Hence, by using the baton manager to manage the baton, accesses to multithreading unsafe resources are serialized while program crashes or deadlocks are minimized. The multithreading unsafe resource will typically have a plurality of baton objects associated therewith. The baton objects are objects of objectoriented programming. The baton manager will permit at most one of the baton objects for a given multithreading unsafe resource to own the baton at a time. The threads associated with the baton objects waiting to own the baton must wait until they receive the baton before they can access the multithreading unsafe resource.
27 Claims, 12 Drawing Sheets