what's the difference between signal and semaphore? | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Unix/Linux Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

what's the difference between signal and semaphore?

UNIX for Dummies Questions & Answers


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 05-21-2011
stackpop stackpop is offline
Registered User
 
Join Date: May 2011
Last Activity: 21 May 2011, 9:42 PM EDT
Location: Shanghai,China
Posts: 2
Thanks: 2
Thanked 0 Times in 0 Posts
what's the difference between signal and semaphore?

dear all~
I am just new here.I am very happy to see such a forum.

I am very puzzled by the difference between signal and semaphore.

What's the difference between signal() wait() and P V operation?

the linux kernel have implemented a good semaphore system,why we need the system V IPC semaphore?
Sponsored Links
    #2  
Old Unix and Linux 05-21-2011
Chirel Chirel is offline
Registered User
 
Join Date: Sep 2010
Last Activity: 17 March 2015, 1:01 PM EDT
Posts: 164
Thanks: 4
Thanked 39 Times in 38 Posts
Hi,

In my understanding for a counting semaphore (which allow an arbitrary resource count), V is = signal() and P = wait().
The Following User Says Thank You to Chirel For This Useful Post:
stackpop (05-21-2011)
Sponsored Links
    #3  
Old Unix and Linux 05-21-2011
stackpop stackpop is offline
Registered User
 
Join Date: May 2011
Last Activity: 21 May 2011, 9:42 PM EDT
Location: Shanghai,China
Posts: 2
Thanks: 2
Thanked 0 Times in 0 Posts
thank you~
I find some answers that the Signal is a technical which is equal to soft interruption.
And a signal can only tell a process what happened,but it can't send data buffers to other process.

Are all these understanding right?

But I just see the signal used to tell the process itself what happened not another process.
    #4  
Old Unix and Linux 05-21-2011
Chirel Chirel is offline
Registered User
 
Join Date: Sep 2010
Last Activity: 17 March 2015, 1:01 PM EDT
Posts: 164
Thanks: 4
Thanked 39 Times in 38 Posts
Right, no data buffers for signal, it's used to tell something coded by a number to a running process.

You can send a running process a signal, it's for example the work done by the kill command.
The Following User Says Thank You to Chirel For This Useful Post:
stackpop (05-21-2011)
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
semaphore gokult Shell Programming and Scripting 0 12-01-2010 04:27 PM
Semaphore italian_boy Programming 2 03-25-2010 11:59 AM
Problem signal() and semaphore carton99 Programming 3 12-10-2009 03:54 PM
semaphore raguramtgr UNIX for Dummies Questions & Answers 7 06-15-2009 09:39 AM
semaphore yls177 UNIX for Dummies Questions & Answers 1 10-08-2002 11:18 PM



All times are GMT -4. The time now is 12:32 AM.