Your goal is to implement a Software Transactional Memory (STM).
The real goal is of course to get you a hands-on experience with actual concurrent programming.
Only basic C or C++ knowledge.
How to use the atomic libraries and the memory models of C11 and C++11 will be taught in the weekly project sessions.
-
Preshing on Programming - Stellar resources and facts about concurrent programming
-
The Art of Multiprocessor Programming - Chapter 18.
You may read and inspire from existing STM libraries, but it must be your own code that carries out transactions.
-
Correctness is a must.
Each transaction must appear atomic. No correctness = no passing grade (for the project only).
-
Throughput is to go from a passing grade to the maximum grade.
Comparison of your implementation to the reference one. Metric: #transaction commits per second.
Precise specification to come.
-
Fork this repository.
-
Make a local copy of the
template
directory with your SCIPER number (e.g.$cp template 123456
). -
Complete (or completely rewrite) your copy of the template with your own code.
-
Complete/rewrite your code; only the interface should be kept identical.
-
Compile and test locally with:
path/to/directory/grading$ make build-libs run
. -
Possibly send your code to the TA for testing on the evaluation machine.
-
Repeat any of the previous steps until you are satisfied with correctness and performance.
-
First iteration:
-
shared_t tm_create(size_t, size_t)
-
void tm_destroy(shared_t)
-
void* tm_start(shared_t)
-
size_t tm_size(shared_t)
-
size_t tm_align(shared_t)
-
tx_t tm_begin(shared_t)
-
bool tm_end(shared_t, tx_t)
-
bool tm_read(shared_t, tx_t, void const*, size_t, void*)
-
bool tm_write(shared_t, tx_t, void const*, size_t, void*)
Second iteration (which adds memory (de)allocation):
-
bool tm_alloc(shared_t, tx_t, size_t, void**)
-
bool tm_free(shared_t, tx_t, void*)