|
From: Niall D. <ndo...@bl...> - 2013-06-20 18:22:00
|
> https://groups.google.com/a/isocpp.org/d/msg/tm/zfRyY_XfxSU/47esUzUcHX > > 0J > > > > In short, I think you should simulate TM directly as effectively a > > "super longjmp" which preserves memory as well as registers. > > I skimmed the (very long) thread but am none the wiser. Can you summarise > what actions the simulator should take in response to XBEGIN and XEND ? 1. All writes by valgrind on behalf of a program being executed need a new trans_ctx pointer. 2. xbegin starts a new memory transaction context such that subsequent writes occur in that context instead. Other threads can't see anything accumulated there. 3. xend commits that context's changes as visible to all other threads and throws away the context. 4. Any thread reading or writing any cache line straddling a memory transaction context causes that context to abort next timeslice. Any syscall or context switch also aborts. The API I have in that thread is a very reasonable starting prototype for an internal API implementing the above. Quite separately, one might wish to use Transactional GCC to implement TM in valgrind's implementation right now. Niall --- Opinions expressed here are my own and do not necessarily represent those of BlackBerry Inc. |