"It releases the lock using normal store"
I think this might be where your confusion is coming from.

This is not true, it does a store conditional not a normal store.  The
store conditional only stores if the context id is still set on the
cacheline.  This code is in (if ruby) src/mem/ruby/system/Sequencer.cc in
Sequencer::handleLlsc().  So if an LL/SC from another thread overlaps,
this guarantees that a thread's SC does not complete the store if the last
load linked was issued by the same thread.



On Mon, Nov 19, 2012 at 10:45 PM, Anusha <[email protected]> wrote:

> I have a question regarding LL/SC implementation in gem5.
>
> For example, if thread 1 performs a LL operation, it sets locked flag to
> context id. During SC operation, lock flag is cleared.
> It releases the lock using normal store and lock flag is cleared during
> any WB.
>
> If another thread (id 2) tries to perform a LL operation, while thread 1
> is in CR, it will set flag to its context id.
>
> The question I have is what will prevent  thread 2 SC from succeeding
> while thread 1 is in CR. I am unable to find a condition that checks if
> another thread is executing CR.
>
> I would really appreciate if someone could clarify this for me.
>
> Thanks,
> Anusha
>
> _______________________________________________
> gem5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to