multithreading - mechanism apart from locking(spin lock, sempahore) for Synchronization -


itemprop = "text">

I know for synchronization in C that there are many mechanisms like spin lock, semaphore, seq lock, conditional variables etc.

This is an interview question, "Is there any other way different?"

By locking for synchronization "I have said that we can use constraints or use it for our own wait, but it can be useful, in some situations there is no such situation

So there is no mechanism other than locking (spin lock, semaphore) for synchronization?

Locking in the kernel is expensive except for the above mentioned SAS RCU: Reed-copy-update which separates the update and reclamation information, where both readers and writers can avoid completely locking.

The above is not a complete option because it Depending on the matter, what you are trying to serialize. You may also consider using per-CPU data structures and avoiding global expensive locks, it is still synchronized with ISR. It needs to be done, while preepation should be disabled. Forgetting to add atomic operations to bits and integers


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -