Recent Changes - Search:

PmWiki

pmwiki.org

edit SideBar

Speculation

It seems to be the general concensus that the JAMAICA architecture should support speculation. There seem to be two strong flavours of speculation at the moment

  • Thread-Level Speculation
  • Transactional Coherence and Consistency

Whilst at first glance these forms of speculation appear to be rather different, they can in fact be expressed as simple modifications/restrictions to each other.


Thread-Level Speculation

Allows a speculative (child) thread to be run in parallel to a non-speculative (parent) thread. Memory stores are tracked between the threads to check for dependeny violations. The speculative thread will be squashed/restarted when a write from the non-speculative thread is to a memory address read since the non-speculative thread was spawned.

At this point, there are two options

a) squash the thread and give up b) restart the thread from the start of its execution again (involves cleaning up state changes) c) some papers talk about restarting from the point where the memory read occured (this seems hard to impossible to acheive with realistic/feasible hardware)

TLS seems to give you the ability to spawn threads and detect and recover from them early on in the speculative thread. TLS would be the same as TCC if violations were tracked only at the point of joining.

In hardware/software a simple TLS could be acheived as follows:

  • New ISA instructions:: THS (thread speculative) and JNS (join speculative) as a minimum
  • On a THS, a similar mechanism to THJ is employed. The PC to a spawn routine is passed as well as a SP. The stack needs to be set up with the working registers of the non-speculative thread. Unlike THJ/THB (?) this stack area needs to be available until the speculation is over. Therefore a garbage collect needs to be able to leave this area intact. This is because a rollback on a squash and restarting would involve revoking the spawn routine which would set up the initial working register set and then branch back to the first instruction in the TLS speculative thread.
  • A JNS instruction, informs the speculative thread that it is now non-speculative and may commit its results freely. This usually involves unsetting some speculative flags stored against the cache lines, and flushing a store buffer to memory.

TCC

Profiles?

Edit - History - Print - Recent Changes - Search
Page last modified on December 16, 2005, at 02:14 AM