https://github.com/randruc/cyclicsyncprocesses
https://github.com/randruc/cyclicsyncprocesses
c posix unix
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/randruc/cyclicsyncprocesses
- Owner: randruc
- Created: 2019-02-11T23:06:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-11T23:21:45.000Z (over 7 years ago)
- Last Synced: 2025-01-20T19:34:53.807Z (over 1 year ago)
- Topics: c, posix, unix
- Language: C
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Remi Andruccioli
February 2019
This is a thought on the interview question dealt by Vorbrodt in this blog post:
http://blog.vorbrodt.me/?p=584
I like the implementation offered in this blog post.
Therefore I decided to post an implementation with 2 processes instead of 2
threads.
The difference is that 2 processes have distinct memory areas by default.
So as one of the many possible implementations, I use Unix pipes as a way of
signaling events.
In each loop the PID of the process is printed followed by the letter A or B.
To compile:
gcc -Wall -Wextra -Werror -pedantic -std=c89 cyclic_sync_processes.c
This source code is under public domain.