26.07.2013, 17:23
I decided to use std::lock_guard to overcome the issue with vector's thread safety. It seemed the most suitable and secure solution (unlocks even on exceptions)
Thanks for the suggestions.
I added the default cost and changed playerid to thread_idx.
About limiting the amount of threads used to 2: Why should this be done? Does it increase stability?
Quote:
Suggestions:
http://www.boost.org/doc/libs/1_54_0...free.queue_hpp Don't use more than 2 threads. Implement a blocking function aswell for those having powerful servers. Make `cost` a default parameter. Also, playerid parameter is useless, you'd better add an "threadidex" parameter. pawn Code:
pawn Code:
|
I added the default cost and changed playerid to thread_idx.
About limiting the amount of threads used to 2: Why should this be done? Does it increase stability?