std.experimental.logger formal review round 3

Robert burner Schadek via Digitalmars-d digitalmars-d at puremagic.com
Wed Nov 12 04:39:22 PST 2014


On Wednesday, 12 November 2014 at 05:36:40 UTC, Jose wrote:
> On Tuesday, 11 November 2014 at 15:06:49 UTC, Dicebot wrote:
>> https://github.com/Dicebot/phobos/tree/logger-safety
>>
> 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

Only one thread can write to one Logger at a time, also known as 
synchronization. Anything else is properly wrong. But you can 
have as many Logger as you have memory.


More information about the Digitalmars-d mailing list