Expedited object locking and unlocking
    1.
    发明授权
    Expedited object locking and unlocking 有权
    快速对象锁定和解锁

    公开(公告)号:US06314563B1

    公开(公告)日:2001-11-06

    申请号:US09283136

    申请日:1999-03-31

    IPC分类号: G06F965

    CPC分类号: G06F9/52 Y10S707/99938

    摘要: An object structure's header (40) allocates a two-bit synchronization-state field (42) solely to monitor data for implementing synchronization on that object. When the object is locked by a particular execution thread, or when one or more execution threads are waiting for a lock or notification on that object, its header contains a pointer to monitor resources in the form of a linked list of lock records (50, 52, 54) associated with the threads involved. The synchronization-state field (42) ordinarily contains an indication of whether such a linked list exists and, if so, whether its first member is associated with a thread that has a lock on the object. When a thread attempts to gain access to that linked list, it employs an atomic swap operation to place a special busy value in that lock-state field (42) and write its execution-environment pointer into the object's header (40). If the previous value of that field was not the special busy value, the thread uses the header's previous contents to perform its intended synchronization operation. Otherwise, it obtains that information through its own execution environment (44, 46, or 48) or that of the thread whose identifier the object header previously contained. When the thread completes its synchronization operation, it employs an atomic compare-and-swap operation to write the results into the object's header if that header still contains the thread identifier that the thread originally wrote there. Otherwise, it communicates that information to its successor thread if the thread identifier is different and thereby indicates that at least one successor is contending for access to the linked list.

    摘要翻译: 对象结构的头部(40)仅分配两位同步状态字段(42)来监视用于实现该对象上的同步的数据。 当对象被特定执行线程锁定时,或者当一个或多个执行线程等待该对象上的锁定或通知时,其头包含指向监视资源的指针,该指针以锁定记录的链表的形式(50, 52,54)与所涉及的线程相关联。 同步状态字段(42)通常包含这样的链表是否存在的指示,如果是,则其第一个成员是否与对象上具有锁定的线程相关联。 当一个线程尝试访问该链表时,它采用原子交换操作在该锁状态字段(42)中放置一个特殊的忙值,并将其执行环境指针写入对象的头(40)。 如果该字段的先前值不是特殊忙值,线程将使用头部的以前内容来执行其预期的同步操作。 否则,它通过其自己的执行环境(44,46或48)或其标识符之前包含对象标题的线程获得该信息。 当线程完成其同步操作时,如果该头仍然包含线程最初在那里写入的线程标识符,它将使用原子比较和交换操作将结果写入对象的头。 否则,如果线程标识符不同,则将该信息传递给其后续线程,从而指示至少一个后继者正在竞争访问链表。

    Busy-wait-free synchronization
    2.
    发明授权
    Busy-wait-free synchronization 失效
    忙等待同步

    公开(公告)号:US06173442B2

    公开(公告)日:2001-01-09

    申请号:US09245778

    申请日:1999-02-05

    IPC分类号: G06F945

    CPC分类号: G06F9/52 Y10S707/99938

    摘要: An object structure's header (40) allocates a two-bit synchronization-state field (42) solely to monitor data for implementing synchronization on that object. When the object is locked by a particular execution thread, or when one or more execution threads are waiting for a lock or notification on that object, its header contains a pointer to monitor resources in the form of a linked list of lock records (50, 52, 54) associated with the threads involved. The synchronization-state field (42) ordinarily contains an indication of whether such a linked list exists and, if so, whether its first member is associated with a thread that has a lock on the object. When a thread attempts to gain access to that linked list, it employs an atomic swap operation to place a special busy value in that lock-state field (42) and write its execution-environment pointer into the object's header (40). If the previous value of that field was not the special busy value, the thread uses the header's previous contents to perform its intended synchronization operation. Otherwise, it obtains that information through its own execution environment (44, 46, or 48) or that of the thread whose identifier the object header previously contained. When the thread completes its synchronization operation, it employs an atomic compare-and-swap operation to write the results into the object's header if that header still contains the thread identifier that the thread originally wrote there. Otherwise, it communicates that information to its successor thread if the thread identifier is different and thereby indicates that at least one successor is contending for access to the linked list.

    摘要翻译: 对象结构的头部(40)仅分配两位同步状态字段(42)来监视用于实现该对象上的同步的数据。 当对象被特定执行线程锁定时,或者当一个或多个执行线程等待该对象上的锁定或通知时,其头包含指向监视资源的指针,该指针以锁定记录的链表的形式(50, 52,54)与所涉及的线程相关联。 同步状态字段(42)通常包含这样的链表是否存在的指示,如果是,则其第一个成员是否与对象上具有锁定的线程相关联。 当一个线程尝试访问该链表时,它采用原子交换操作在该锁状态字段(42)中放置一个特殊的忙值,并将其执行环境指针写入对象的头(40)。 如果该字段的先前值不是特殊忙值,线程将使用头部的以前内容来执行其预期的同步操作。 否则,它通过其自己的执行环境(44,46或48)或其标识符之前包含对象标题的线程获得该信息。 当线程完成其同步操作时,如果该头仍然包含线程最初在那里写入的线程标识符,它将使用原子比较和交换操作将结果写入对象的头。 否则,如果线程标识符不同,则将该信息传递给其后续线程,从而指示至少一个后继者正在竞争访问链表。