Imagine that you are developing a multi-threaded application which proceeds concurrently many read and some write requests on a shared data structure. Your goal is to speed up the application so that there is as much read operations as possible while keeping the same amount of write operations.
Steps
git clone https://gitlab.fel.cvut.cz/matejjoe/rcu.git
make
in rcu directory)
./list_mutex <number of reader threads>
) and measure read operations and their scalability
ssh username@ritchie.ciirc.cvut.cz
(KOS password)
The rwlock is part of pthread library. You could be interested in:
The liburcu should work on Linux, Cygwin and MacOS X. You can obtain liburcu from distribution repository or compile yourself. If you want to use your own machine, I would recommend you to use library from distribution repository (`sudo apt install liburcu-dev`). In order to compile and use the library do the following:
wget https://lttng.org/files/urcu/userspace-rcu-latest-0.11.tar.bz2 tar -xjf userspace-rcu-latest-0.11.tar.bz2 cd userspace-rcu-0.11.1/ ./configure --prefix=/home/me/somefolder/mybuild/output/target make -j8 make install
-lurcu
or other rcu flavour into $LIBS
(before -lpthread
)
-I/home/me/somefolder/mybuild/output/target/include
into $INCLUDES
-L/home/me/somefolder/mybuild/output/target/lib
into $LFLAGS
Examples how to use liburcu are available also on github: https://github.com/urcu/userspace-rcu/tree/master/doc/examples/list
If you want to share your session with me, type tmux-share joel
.