Skip to main content
6 votes
Accepted

Multithread execution times are slow on Ubuntu and fast on Windows

Use C++'s random number generators instead of rand() Not only is this good advice in general, it's actually the main source of your performance problems. You use <...
G. Sliepen's user avatar
  • 55.7k
5 votes
Accepted

Multithreading message queue system

Use wait() with a predicate I recommend that you always pass a predicate to wait() that checks whether the condition you are ...
G. Sliepen's user avatar
  • 55.7k
3 votes

Portable periodic/one-shot timer thread - follow-up

I have spotted one more scenario for deadlock in addition to calling clear from the timer. This scenario arises when the conditional wait timer is last one. In this case, the lock obtained by timer....
Vinod Kumar Singh's user avatar
2 votes

Portable periodic/one-shot timer thread - follow-up

It would have been nice to have an example program to experiment with. I don't like the mix of durations and bare numbers (milliseconds) in the interface (or in the implementation, but that's a ...
Toby Speight's user avatar
  • 75.1k
2 votes
Accepted

Multi-threaded Error Handling Data Fetching Script

Exception Handling: The current exception handling is quite broad (except:). It is worse than broad in the main block, it is nonexistent since you are swallowing all exceptions, making your program ...
Kate's user avatar
  • 6,560
2 votes

Time based cache for single element

Duration One small issue… You pass around your time to expire as a a mere long for a count of milliseconds. But we have a class ...
Basil Bourque's user avatar
2 votes

PasteBin API scraper for new public pastes that appear at regular intervals

There is no need to initialize an array to an empty list when declaring the variable: my @flaggedRegex = (); This is simpler and cleaner: ...
toolic's user avatar
  • 3,375
1 vote

Rust publish/subscribe channel library

I've found your crate looking for existing pub-sub solutions. Time has passed and there is now a good choice. async-broadcast lists a few. Review their comparisons to others. There are some situations ...
Robert Cutajar's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible