U++ framework
Do not panic. Ask here before giving up.

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: 1319
Registered: March 2007
Ultimate 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: Tue Apr 28 23:14:28 GMT+2 2026

Total time taken to generate the page: 0.00878 seconds