| | |
implement semaphore without the use of while or any if statement
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Feb 2007
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 10:12 pm.
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
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
Views: 2279 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays bash binarysearch centimeter char convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory drawing dynamic executable fflush file fork frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hardware highest homework i/o inches infiniteloop initialization interest kilometer km lazy linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling segmentationfault send shape socketprograming spoonfeeding stack standard strchr string strings structures student suggestions system systemcall test testautomation unix user voidmain() wab win32 win32api windows.h






