Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/afkewolczyk/my-locks

An operating systems assignment, measuring the effectiveness and speed of different types of locks.
https://github.com/afkewolczyk/my-locks

c linux lock operating-systems spinlock-test thread

Last synced: 6 days ago
JSON representation

An operating systems assignment, measuring the effectiveness and speed of different types of locks.

Awesome Lists containing this project

README

        

# Author
Afke Holgersen

## Locks Implementations
As an assignment for an Operating Systems class, 4 locks were implemented in C and compared with the pthread locks from the pthread library:

- Spinlock test-and-set
- Spinlock test-and-test-and-set
- Mutex (exponential backoff) lock
- Queue (Ticket) lock

All locks are recursive safe, meaning the same thread can only release a lock if it is locked the same number of times.

## Compile and Execution Instruction

To execute this program, the user must clone this project to his own repository and access the project directory through his own terminal.
This can be done by using the command "Cd".

Before execution, compilation can be done by using the "make"command.

To execute, the user must use the following command to start the program :
./mylocks -t #threads -i #Iterations -o #OperationsOutsideCS -c #OperationsInsideCS -d testid

The user is responsible for directing operations, numbers of threads and locks intended to test. This can be done through the terminal, and by defining testid. The test id is a code that the user can define by using the following glossary :
testid: 0=all, 1=pthreadMutex, 2=pthreadSpinlock, 3=mySpinLockTAS, 4=mySpinLockTTAS, 5=myMutexTAS, 6=myQueueLock