Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
emerson_clarke
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
emerson_clarke
9y ago
This would not work for floating point arithmetic in computing. The order in which you perform a calculation changes the outcome, since not every number can be precisely represented by the IEEE 754 standard.
2.
▲
by
emerson_clarke
12y ago
This reminds me of a kind of intelligence scale ive seen before: First there are stupid people, and then there are stupid people who know they are stupid, then there are smart people who think they are smart, and finally there are smart peo
3.
▲
by
emerson_clarke
12y ago
The stack head pointers can be swapped and flushed without knowing how much data is in it. However, if you need to know the count/size... Then in general you must accept that the count/size of the write stack is dynamic, so even i
4.
▲
by
emerson_clarke
12y ago
Im sure im not the first to have done something like this for logging or buffering in general, but im not aware of any writeups. Information on lock free data structures and the caveats (they are extremely difficult to get right) is freely
5.
▲
by
emerson_clarke
12y ago
I think you misunderstand the CAS operation. It performs an atomic compare and swap on a pointer (32 or 64 bits), so obviously it requires no coordination to switch out the head pointer of a stack. For example, on an LP64 architecure:
6.
▲
by
emerson_clarke
12y ago
Unfortunately no, thus far i have only implemented it in a commercial context as part of a high frequency trading system.
7.
▲
by
emerson_clarke
12y ago
Another approach is just to use two stacks, one for writing and one for flushing. User threads write log lines directly to buffers from an allocator usually via a TLS mediated stream. The use of an allocator avoids locking on system calls
8.
▲
by
emerson_clarke
16y ago
I just put a similar response in another post, but its just as appropriate here... If you want to know how C++ can be better, you should take a look at at the Reason C++ framwork, especially if you have never seen C++ in its most pure uncom
9.
▲
by
emerson_clarke
16y ago
If your currently in an apoplectic fit as to why people don't love C++, const correctness, boost, and the standard library, then read no further. For those with a slightly broader perspective and an inquisitive mind, perhaps you should take