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 |
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
|
|
|
|
|
What is the best way to create a Semaphore with timeout?
By: Tom1 on Tue, 17 December 2019 09:49
|
|
|
Re: What is the best way to create a Semaphore with timeout?
By: Tom1 on Tue, 17 December 2019 10:49
|
|
|
Re: What is the best way to create a Semaphore with timeout?
By: Tom1 on Tue, 17 December 2019 11:53
|
|
|
Re: What is the best way to create a Semaphore with timeout?
By: mirek on Thu, 19 December 2019 11:38
|
|
|
Re: What is the best way to create a Semaphore with timeout?
By: Tom1 on Thu, 19 December 2019 12:59
|
|
|
Re: What is the best way to create a Semaphore with timeout?
By: mirek on Thu, 19 December 2019 13:40
|
|
|
Re: What is the best way to create a Semaphore with timeout?
By: Tom1 on Thu, 19 December 2019 14:38
|
|
|
Re: What is the best way to create a Semaphore with timeout?
By: mirek on Thu, 19 December 2019 17:05
|
|
|
Re: What is the best way to create a Semaphore with timeout?
By: Tom1 on Thu, 19 December 2019 21:44
|
|
|
Re: What is the best way to create a Semaphore with timeout?
By: mirek on Wed, 22 January 2020 14:44
|
|
|
Re: What is the best way to create a Semaphore with timeout?
By: Tom1 on Wed, 22 January 2020 14:48
|
Goto Forum:
Current Time: Wed Apr 24 15:20:44 CEST 2024
Total time taken to generate the page: 0.05059 seconds
|