Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Semaphore implementation (http://www.go4expert.com/forums/semaphore-implementation-t2850/)

sonu2die4 5Feb2007 08:23

Semaphore implementation
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

shabbir 5Feb2007 09:22

Re: Semaphore implementation
Start the B thread from A and C from B and the job is done.

sonu2die4 5Feb2007 09:25

Re: Semaphore implementation
but how would i implement a semaphore for that

shabbir 5Feb2007 09:53

Re: Semaphore implementation
But why do you need semaphore?

All times are GMT +5.5. The time now is 22:32.