Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » What is the best way to create a Semaphore with timeout?
What is the best way to create a Semaphore with timeout? [message #52857] Tue, 17 December 2019 09:49 Go to previous message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi,

I need a Semaphore with Wait(int timeout_ms); What is the best way (in terms of efficiency) to implement this timeout functionality?

Using SetTimeCallback() to Release() the Semaphore is not an option in non-GUI environment. Another thread Sleeping for the specified amount of time and then calling Release feels a bit inefficient.

(For the background: I'm building a FIFO using BiVector and wish to get minimal latency and overhead for the operation.)

Best regards,

Tom
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Linux binary application distribution options?
Next Topic: Adding Version Information & Icons to app's txt file
Goto Forum:
  


Current Time: Wed Apr 24 15:20:44 CEST 2024

Total time taken to generate the page: 0.05059 seconds