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

  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 Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 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 05-21-2011
Chirel Chirel is offline
Registered User
 
Join Date: Sep 2010
Last Activity: 19 May 2013, 2:53 AM EDT
Posts: 162
Thanks: 4
Thanked 38 Times in 37 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 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 05-21-2011
Chirel Chirel is offline
Registered User
 
Join Date: Sep 2010
Last Activity: 19 May 2013, 2:53 AM EDT
Posts: 162
Thanks: 4
Thanked 38 Times in 37 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 Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 01:35 AM.