« first day (1112 days earlier)      last day (4062 days later) » 

23:00
haha
C'mon, it's 00:00 here.
Same here :P
And I've been playing EVE for 5 hours in a row.
Excuses...
I guess the answer should be "it depends on whether the move out of pair elements should be conditional or not" :D
23:04
I'm working on this logging utility. It should hold the input arguments and then pass it via a lock-free queue to the thread which performs the writing of the log message.
user1804599
Where can I find a good guide on writing custom allocators?
The C++ Programming Language perhaps.
let me check
4th edition chapter 34.4 is about Allocators.
Not sure if it is comprehensive, but it should be a good introduction.
34.5 is about the garbage collector interface
But it's probably too brief.
There's also the book about the standard library.
ooh, discovered something neat in ksp
@StackedCrooked do you really want to use log << a << b syntax? log(a, b) would be easier for both you and library users
and it's pretty easy with variadic templates
23:18
minmus has low enough gravity that you can land a kerbal on it just using jetpack :D
@Rapptz yep, and probably with make_tuple to store stuff in a tuple
@Rapptz not spooky enuff 4 me
@StackedCrooked Why stop at lock-free? cs.technion.ac.il/~erez/Papers/wf-methodology-ppopp12.pdf
@StackedCrooked save the starving threads, implement a wait-free data structure
23:37
I don't really understand the difference.
lock-free guarantees system-wide progress, but allows individual threads to starve
wait-free guarantees no thread will starve
for example, if there's 3 contenders for a resource, A, B, C and the system assigns the resource constantly to A, B, A, B, A, B, there is system-wide progress, but C is starved
wait-free guarantees that if a thread wants a resource he can get it within a certain finite bound of waiting
23:54
@nightcracker not really my use-case.
The business code must not be hindered by the logging. The consumer thread which does actual logging may be starved, since logging is not the primary feature.
I want to avoid having allocations on the main thread. Therefore I compose the log message without using a stringstream or anything.
So Log() << 1 << "a" << false; composes a LogItem<int, LogItem<char [2], LogItem<false, Log>>> which is pushed to the lock-free queue.
All on the stack, and hopefully inlined and optimized.
However, the creation of the std::function probably does require allocation.

« first day (1112 days earlier)      last day (4062 days later) »