cancel
Showing results for 
Search instead for 
Did you mean: 
jeesshnasree
Flight Engineer
Flight Engineer
  • 3,827 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
  • 3,781 Views

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

-STM

--
Manager, Technical Marketing
Red Hat Enterprise Linux
Red Hat Certified Engineer (100-000-264)

View solution in original post

0 Kudos
3 Replies
Scott
Starfighter Starfighter
Starfighter
  • 3,801 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

 

 

--
Manager, Technical Marketing
Red Hat Enterprise Linux
Red Hat Certified Engineer (100-000-264)
0 Kudos
jeesshnasree
Flight Engineer
Flight Engineer
  • 3,797 Views

Hi @Scott ,

thanks for share valuable information.

0 Kudos
Scott
Starfighter Starfighter
Starfighter
  • 3,782 Views

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

-STM

--
Manager, Technical Marketing
Red Hat Enterprise Linux
Red Hat Certified Engineer (100-000-264)
0 Kudos
Join the discussion
You must log in to join this conversation.