Quantcast
Channel: User Peter - Reinstate Monica - Stack Overflow
Viewing all articles
Browse latest Browse all 239

Comment by Peter - Reinstate Monica on How can I block for one request at a time, and when it completes, then process the most recent, completing older requests with no processing?

$
0
0
Shouldn't a (thread safe or manually locked) stack data structure work? Because its nature is "last in/first out" which is what you want. Requests go on the stack. When it's time to work on the next request, you always pop the newest one from the stack and then empty the stack (thus discarding the obsolete requests) in an atomic (i.e. synchronized) single action.

Viewing all articles
Browse latest Browse all 239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>