发明授权
US6134627A Thread synchronization in a computer controlled by an object-based
program
失效
由基于对象的程序控制的计算机中的线程同步
- 专利标题: Thread synchronization in a computer controlled by an object-based program
- 专利标题(中): 由基于对象的程序控制的计算机中的线程同步
-
申请号: US743484申请日: 1996-11-04
-
公开(公告)号: US6134627A公开(公告)日: 2000-10-17
- 发明人: Lars Bak
- 申请人: Lars Bak
- 申请人地址: CA Palo Alto
- 专利权人: Sun Microsystems, Inc.
- 当前专利权人: Sun Microsystems, Inc.
- 当前专利权人地址: CA Palo Alto
- 主分类号: G06F9/44
- IPC分类号: G06F9/44 ; G06F9/46 ; G06F12/00 ; G06F12/14 ; G06F9/00
摘要:
A method for synchronizing threads in a computer operating under control of a program written in an object-based computer programming language provides for a first thread to lock an object by moving the object header to a stack address and replacing the header with the stack address. The first thread unlocks the object by returning the header to its associated memory location. Second and subsequent threads attempting to access a locked object detect the presence of the stack address in the header memory location and suspend their attempts to access the object. When using aligned stacks, all stack addresses will be even, and all object-headers will be odd. Threads efficiently check the status of the object by testing the least significant bit. A preferred method is implemented in a "JAVA" just-in-time compiler of a "JAVA" virtual machine.
信息查询