std.experimental.logger formal review round 3

Jose via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 11 21:36:38 PST 2014


On Tuesday, 11 November 2014 at 15:06:49 UTC, Dicebot wrote:
> https://github.com/Dicebot/phobos/tree/logger-safety
>
> I think that should be it for now

I could have completely missed some details but I took sometime 
to look at the code after reading that the logger was holding a 
lock during the write operation. I noticed the following lines.

One shared Logger:
https://github.com/burner/phobos/blob/logger/std/experimental/logger/core.d#L1696

One global function that references that shared Logger:
https://github.com/burner/phobos/blob/logger/std/experimental/logger/core.d#L292

And more importantly a Mutex that is always acquired when writing:
https://github.com/burner/phobos/blob/logger/std/experimental/logger/core.d#L1035

Does this mean that if I use this library on a machine that has 
32 cores, 100s of threads and 1000s of fiber only one 
thread/fiber can write at a time no matter the concrete 
implementation of my logger? Am I missing something or isn't this 
a non-starter?

Thanks,
-Jose




More information about the Digitalmars-d mailing list