1

I have got a project where I have to implement semaphores in Minix.
In order to implement them I need to make the semaphore wait and signal functions atomic.

My idea is that

Assuming that system calls are atomic in Minix ,
I will create new system calls that implement the wait and signal functions.


That's why I want to know that
Are Minix "system calls" in C atomic in nature?

Harsh Agarwal
  • 675
  • 2
  • 13
  • 28
  • What do you mean by atomic? – Vality Mar 09 '17 at 22:12
  • System calls are not usually thought of as atomic operations in the sense that they do not execute as a single atomic instruction on the CPU level. Function calls rarely (never) do, after all. As it happens the sort of atomicity you are looking for is an atomic operation on the CPU instruction level, in order to avoid data races on the value you are trying to monitor (the boolean representing your lock state). – user268396 Mar 09 '17 at 22:16
  • By atomic I mean as given [here](https://en.wikipedia.org/wiki/Linearizability) @Vality – Harsh Agarwal Mar 09 '17 at 23:03

0 Answers0