Real-time Task Models in Linux POSIX (pthreads) with demonstration usage of Mutex and semaphores to control the thread execution order and check for priority inversion.
Makefile 3.46%C 96.54%
linux-posix-multithreading's Introduction
Steps to install and run -
Note: You may need to edit some compile paths and/or the galileo ssh IP depending on your configuration. The Makefile is highly configurable, and you only need to change the values of certain variables.
1.To compile the hcsr driver and userspace program
Cross compile for galileo - make galileo
2. Copy over to galileo using - make scp
3. Run on galileo
a. Install the module -
chmod +x ./ins_p2
./ins_p2 <num_devices>
For example: ./ins_p2 2
b. Run the script for sysfs
chmod +x ./run_p2
./run_p2 <num_devices>
For example: ./run_p2 2
c. Run the userspace program
./hcsr_tester 1 0 1 3 5000
The format is: {./hcsr_tester num_devices io_trig_pin io_echo_pin num_samples sampling_period}
Another example: For 2 devices -
./hcsr_tester 2 0 1 3 5000 19 6 3 5000