Skip to content

Latest commit

 

History

History
17 lines (17 loc) · 774 Bytes

README.md

File metadata and controls

17 lines (17 loc) · 774 Bytes

Ricart–Agrawala Algorithm

Implementation of Ricart-Agrawala algorithm based on a library made in task 1.
Description is available in Russian (original) and English (translated and shorted).

ru

Task description in Russian

en

Description

Each child process should print to the terminal message in log_loop_operation_fmt (specified in pa2345.h) id * 5 times.

Build

clang -std=c99 -Wall -pedantic *.c -L. -lruntime

Run

export LD_LIBRARY_PATH="LD_LIBRARY_PATH:/path/to/pa4/dir";  
### empty line
LD_PRELOAD=/full/path/to/llibruntime.so ./pa4 -p <proc_num> [--mutexl]

--mutexl - if flag is specified, the child process will enter the critical section before printing to terminal.