implement semaphore without the use of while or any if statement
Please support our C advertiser: Programming Forums
![]() |
•
•
Posts: 2
Reputation:
Solved Threads: 0
Hello,
I want to know how to implement semaphore without the use of while or any if statement
The Problem is
Thread A , B , C they all want to output the result at the same time
A wants ot print 'A'
B wants to print 'B'
C wants to print 'C'
the output must be 'ABC'. I do not know how to do this.Please help me with the same
Regards
Sonu
I want to know how to implement semaphore without the use of while or any if statement
The Problem is
Thread A , B , C they all want to output the result at the same time
A wants ot print 'A'
B wants to print 'B'
C wants to print 'C'
the output must be 'ABC'. I do not know how to do this.Please help me with the same
Regards
Sonu
Last edited by sonu2die4 : Feb 4th, 2007 at 9:12 pm.
Post your attempt and maybe then we would be able to help you out...
I don't accept change; I don't deserve to live.
Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.
-- Eric Naggum RIP :-(
Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.
-- Eric Naggum RIP :-(
Here is information you need. After creating a semaphore your program calls one of the wait functions to gain access to it. When the ReleaseSemaphore() is canned another thread that is waiting will be released.
![]() |
Similar Threads
Other Threads in the C Forum
- frustrated newbie needs help (C++)
- qbasic program under Windows XP (Legacy and Other Languages)
- Urgent:need Help (C++)
- change statement (JSP)
- Create Windows Authentication (VB.NET)
- Reading MSWord Document through an ASP Statement (ASP)
Other Threads in the C Forum
- Previous Thread: c coding on linux
- Next Thread: Checking if the socket is valid in C
•
•
•
•
Views: 1928 | Replies: 3 | Currently Viewing: 1 (0 members and 1 guests)






Linear Mode