943,670 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Marked Solved
  • Views: 3032
  • C RSS
May 22nd, 2007
0

Using a Semaphore in Reentrant function

Expand Post »
Can anyone tell me whether it is allowed to use a Semaphore in a Reentrant function.
Similar Threads
Reputation Points: 29
Solved Threads: 0
Newbie Poster
venuaccha is offline Offline
9 posts
since May 2007
May 22nd, 2007
0

Re: Using a Semaphore in Reentrant function

Do you mean 'will the compiler complain' - no.
'Is it a good idea' - Again, probably not.

Reentrant functions should have all of their data passed to them as arguments, and not use global data structures. Semaphores are traffic cops for access to global objects or shared objects.

This sounds like a threads design problem. What are you trying to do?
Reputation Points: 62
Solved Threads: 10
Junior Poster
jim mcnamara is offline Offline
179 posts
since May 2004
May 22nd, 2007
0

Re: Using a Semaphore in Reentrant function

I got the answer from below link.
http://www.unet.univie.ac.at/aix/aix...m#o8Nfj357manu



Do you mean 'will the compiler complain' - no.
'Is it a good idea' - Again, probably not.

Reentrant functions should have all of their data passed to them as arguments, and not use global data structures. Semaphores are traffic cops for access to global objects or shared objects.

This sounds like a threads design problem. What are you trying to do?
Reputation Points: 29
Solved Threads: 0
Newbie Poster
venuaccha is offline Offline
9 posts
since May 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: error 356?
Next Thread in C Forum Timeline: creating archives





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC