•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 456,420 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,623 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums
Views: 1278 | Replies: 3
![]() |
•
•
Join Date: Feb 2007
Posts: 2
Reputation:
Rep Power: 0
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 10:12 pm.
•
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,541
Reputation:
Rep Power: 40
Solved Threads: 972
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.
![]() |
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- 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



Linear Mode