Speculation API
We employ a user-level API that exposes the read and
write accesses to shared data structures. This API allows
the runtime to track access to data blocks and transparently
manage pointers to support various speculation actions. Recursive programs typically employ a coarser base case, and
we instrument the program at this granularity. This approach is similar to API support for optimistic concurrency
employed in other contexts [7].
Tasks request pointers to the shared data structures using
the following data management API:
• createRegion (id, size): Create a block of size elements
identified by id.
• readAccess (id): Obtain a pointer to a block identified
by id for reading.
• writeAccessBegin(id): Obtain a pointer to a block identified by id for writing.
• writeAccessEnd(id): Mark the end of writes to a block
identified by id by this task.
• taskEnd(): Mark this task’s completion (or return).