1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

Introduce ThreadsManager class

Main aim of this patch is to consolidate all the thread related stuff
behind a single class interface so to avoid messing with global flags
and having thread code scattered among non-thread related stuff.

Another advantage is that now access to thread's variables is
more controlled, in particular we can differentiate between
read and write accesses by the mean of different interfaces, it
is so simpler to understand how a function is related to threads.

Lastly this rewrite is the base for future code consolidations and
semplifications that are easier now that we have only one thread's
access point.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-02-13 13:38:32 +01:00
parent fb5ba1d329
commit 2b740f5495
2 changed files with 449 additions and 439 deletions

File diff suppressed because it is too large Load diff

View file

@ -66,9 +66,6 @@ struct SplitPoint {
struct Thread {
Thread() { memset(this, 0, sizeof(Thread)); }
SplitPoint *splitPoint;
volatile int activeSplitPoints;
uint64_t nodes;
@ -78,7 +75,7 @@ struct Thread {
volatile bool idle;
volatile bool sleeping;
volatile bool workIsWaiting;
volatile bool printCurrentLine;
volatile bool printCurrentLineRequest;
unsigned char pad[64]; // set some distance among local data for each thread
};