https://bugs.kde.org/show_bug.cgi?id=344524

--- Comment #17 from Julian Seward <jsew...@acm.org> ---
Also, your implementation uses guest_state.LLaddr == 0 to mean "there
is no transaction in progress".  So guest_state.LLaddr == 0 has a special
meaning that is different from all other values.

I'd prefer to remove that special meaning and instead use a third
boolean field.  Also, it seems safer to invalidate any in-progress
transaction when the thread is scheduled, not de scheduled.  So my
pseudocode summary so far is

  LoadLinked(addr)

    gs.LLvalid = 1
    gs.LLaddr  = addr
    gs.LLdata  = *addr

  StoreCond(addr, data)

    if gs.LLvalid != 1)   -> fail
    if addr != gs.LLaddr  -> fail
    if *addr != gs.LLdata -> fail
    cas_ok = CAS(addr, gs.LLdata -> data)
    if !cas_ok            -> fail
    gs.LLvalid = 0
    succeed

  When thread scheduled

    gs.LLvalid = 0

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to