This project entails the implementation of a linked list, featuring the Member, Insert, and Delete functions. The program is designed to operate in three different modes:
- Serial Mode: A single-threaded execution.
- Parallel Mode with Mutex: Multi-threaded execution with a single mutex governing the entire linked list.
- Parallel Mode with Read-Write Locks: Multi-threaded execution with read-write locks applied to the entire linked list.
Prior to conducting experiments, the linked list is initialized with 1000 elements, each ranging from 0 to 2^16.
This project was developed and compiled within the CLion IDE. To ensure proper execution, please follow these steps:
-
Open the CMakeLists.txt file and add the following lines:
set(GCC_COVERAGE_COMPILE_FLAGS "-pthread") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}")
-
Adjust the number of samples (N) as necessary in the main.c file.
-
With these instructions in place, you can compile and run the program effectively in your chosen development environment.
-
After running the main.c with your preferred compiler, three separate csv files will be generated, each containing the average execution times and standard deviation for the three cases in output folder.