top of page

Milestone

Milestone Progress

To get started, we first implemented a basic thread-unsafe version of our skip list using C++ and
constructed a workload to test its correctness by comparing its result with std::map. On top
of this basic code, we have successfully completed two locking versions of our skip list, that is,
the global locking version and the fine-grained per-pointer locking version, based on algorithms
introduced by Pugh [1]. In addition, a workload has been built to empirically evaluate the
correctness of our locking implementations. On the 8-core GHC machine, We first spawned 8
threads to concurrently insert 215 consecutive integers to the skip list. Then a large outer loop
will iterate on the range of 1 to 215. During each iteration, an intense inner loop is executed
by the 8 threads, each of which performs high-contention operations on its assigned position
by continuously get, erase, and insert to the position a fixed number of times. After this,
we will examine the value of each of the 215 integers and finally, erase all numbers in the skip
list concurrently. Using this empirical workload, we found that even the most subtle bug and
deadlock can be exposed within less than two runs of the test.


For our fine-grained locking version, lazy deletion is employed when erasing a key-value pair in
case that some other threads are still accessing the deleted node. Similar to [1], we let the next
pointer of the deleted node point to its previous node to ensure that other threads accessing the
deleted node can still make progress. This method, however, imposes a challenge for garbage
collection because unlike other programming languages such as Java, C++ has no GC features.
Fortunately, we found an open-source C++ garbage collector called Boehm Garbage Collector.
In the constructor of our fine-grained locking skip list, we first allocate the header node using
GC MALLOC UNCOLLECTABLE primitive, indicating that the header is not garbage-collectable but
can be treated as the root of other memory allocations. This means that the garbage collector
will scan the header and track other memory locations referenced by pointers inside of the
header. Then in the insert function, we allocate a new node by using GC MALLOC primitive,
which indicates that the node is garbage-collectable as long as no other pointer is referencing to
it. By doing garbage collections, we ensure the correctness of our fine-grained locking version
during erase operations, while preventing the program from memory leakage.

Milestone Progress

Compare to the project proposal, we crossed off achieved goals here and made the plan of the next 3-week more detailed.


week 1 (11.1 - 11.7) Submit the project proposal, read reference papers thoroughly, and start to implement a skip list with a global lock.


week 2 (11.8 - 11.14) Work on the skip list with fine-grained locks.

week 3 (11.15 - 11.21) Test the correctness of the skip list with a global lock and the skip list with fine-grained locks. Work on the project milestone report.


week 4

(11.22 - 11.25) Implement the lock-free version based on algorithms in [2]. (Longyu Yang)
(11.26 - 11.28) Build test cases to evaluate the correctness of the lock-free version. (Zidong Li)


week 5

(11.29 - 12.2) Build interesting workloads to evaluate the performance of these three implementations. (Longyu Yang, Zidong Li)
(12.3 - 12.6) Draw performance graphs and finish up the final project report. (Longyu Yang, Zidong Li)


week 6
(12.7 - 12.9) Prepare for the final poster session.(Longyu Yang, Zidong Li)

Poster Session Goals

  • We PLAN TO show individual speedup plots on high-thread count scenario with respect
    to 1-thread scenario of our three implementations respectively. This will illustrate the
    scalability of our three versions of skip list.

  • We PLAN TO illustrate the performance comparisons by using several graphs, each of which
    shows the operation throughput or speedup of those three implementations with different
    workloads that we construct. This will illustrate whether the fine-grained locking version
    performs better than the global locking version and whether the performance can benefit
    more from non-blocking lock-free implementation.

Concerns

Here are a few aspects that we think are still facing uncertainty.

  • It’s challenging to construct interesting workloads that are able to differentiate the performance
    of our different implementations. To tackle this issue, we might refer to random
    workloads constructed in previous works, such as [2] and [3].

  • As mentioned earlier, we use Boehm Garbage Collector in our fine-grained locking implementation
    to support lazy deletion. And we also plan to use it in our lock-free implementation.
    However, we are not sure how the garbage collection overhead will affect the performance
    of our code.

​​

References

[1] W. Pugh, “Concurrent maintenance of skip lists,” Department of Computer Science, University of Maryland, 06 1990.
[2] K. Fraser, “Practical lock-freedom,” PhD thesis, University of Cambridge, 01 2004.
[3] M. Herlihy, Y. Lev, V. Luchangco, and N. Shavit, “A provably correct scalable concurrent skip list,” in Conference On Principles of Distributed Systems (OPODIS). Citeseer, p. 103, Citeseer, 2006.

bottom of page