cancel
Showing results for 
Search instead for 
Did you mean: 
jeesshnasree
Starfighter Starfighter
Starfighter
  • 5,220 Views

What is semaphore in Linux OS

Jump to solution

Hi all,

 

how to check semaphore running or not. How to clear semaphore in Linux OS. 

What are the advantage for clear semaphore.

 I am waiting for your valuable reply.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Scott
Starfighter Starfighter
Starfighter
  • 5,174 Views

If this is the solution to your question, please don't forget to "Accept as Solution".

-STM

View solution in original post

0 Kudos
3 Replies
Scott
Starfighter Starfighter
Starfighter
  • 5,194 Views

Semophores are not a service, they are a memory construct provided by the linux kernel.  So to answer your first question running or not, the answer is Not Applicable.  To see which ones are in use,  /proc/sys/sysvipc/sem

How to clear one?  I have no idea.  As a systems administrator that's not something we would really, ever, want to do.  Semaphores are a type of shared memory used to pass data between threads of an application.  So by us externally modifying the contents of a semaphore, that would have consequences for any application utilizing that semaphore.

Semaphores are used in the application programming world, here's a pretty in-depth article on the types, uses, and system calls for them in Linux that I found:

https://0xax.gitbooks.io/linux-insides/content/SyncPrim/linux-sync-3.html

From a System Administration view, I think you'd be interested in the /proc/sys/kernel/sem file since that's where the values for how many and the sizes of the semaphore arrays are stored (and changable).

-STM

 

 

0 Kudos
jeesshnasree
Starfighter Starfighter
Starfighter
  • 5,190 Views

Hi @Scott ,

thanks for share valuable information.

0 Kudos
Scott
Starfighter Starfighter
Starfighter
  • 5,175 Views

If this is the solution to your question, please don't forget to "Accept as Solution".

-STM

0 Kudos
Join the discussion
You must log in to join this conversation.