Semaphore api

Started by
4 comments, last by Beer Hunter 18 years, 4 months ago
I am using visual C++ 2003 in windows XP. I need semaphore in my program, what API should I use for that? What is the most updated and recomended API I should use? Is semaphore not a standard user program service in windows? What should I use instead? Thanks in advance.
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower.Quote:Original post by Toolmaker Quote:Original post by The C modest godHow is my improoved signature?It sucks, just like you.
Advertisement
I have found the create_semaphore and wait, but how do I do signal to the semaphore?
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower.Quote:Original post by Toolmaker Quote:Original post by The C modest godHow is my improoved signature?It sucks, just like you.
CreateSemaphore
ReleaseSemaphore
WaitForSingleObjetc
Using Semaphore Objects
Semaphore Objects

All of which are linked from the CreateSemaphore page.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Ok, actually I have already seen it, but I didnt notice that the release semaphore is actually the signal mechanisem.
Thanks

Another question, don't I need to release the HANDLE somewhere? how do I release it?
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower.Quote:Original post by Toolmaker Quote:Original post by The C modest godHow is my improoved signature?It sucks, just like you.
just a FYI: the Boost.Threads library is pretty slick
Quote:Original post by The C modest god
Another question, don't I need to release the HANDLE somewhere? how do I release it?
You can release it with CloseHandle.

This topic is closed to new replies.

Advertisement