/concurrent-linked-list

CS4532 - Concurrent Programming - Lab 1

Primary LanguageC

Linked List Implementations

Implementations of a linked list as a:

How to compile and run the programs:

  • linked_list.c
gcc -o linked_list linked_list.c -lm
./linked_list
  • linked_list_one_mutex.c
gcc -o linked_list_one_mutex linked_list_one_mutex.c -lm -pthread
./linked_list_one_mutex
  • linked_list_one_rwlock.c
gcc -o linked_list_one_rwlock linked_list_one_rwlock.c -lm -pthread
./linked_list_one_mutex

According to the cases the following need to be changed:

int n = 1000;    // number of elements initially in linked list
int m = 10000;    // number of random operations count

float m_member = 0.50;    // fraction of member operations from m
float m_insert = 0.25;    // fraction of insert operations from m
float m_delete = 0.25;    // fraction of delete operations from m

Additionally in (b) and (c) programs the thread count also need be changed.

int thread_count = 1;	// number of threads