News for hackers. Stuff that matters.
Re:C++11 Continuations - High Performance JNI by code-dog on Tuesday April 24, 2012 @10:08AM (#3883986)
The implementation is compiler dependant. Nevertheless, it would appear that the normal implementation is to create something which looks like a normal object with pointers back to the state it closes around. In theory it should be fast and light. The problem (as always with C++) is ensuring that the things to which the pointers point does not go away. Smart pointers help - but they are slow...
Re:C++11 Continuations - High Performance JNI by gurkendoktor on Tuesday April 24, 2012 @12:54PM (#3884883)
I think the most common use case for blocks in C++ are functional-ish STL algorithms, unlike C blocks, which were built for async operations. In that use case, they absolutely shine - since they don't outlive their parent scope, no memory management is necessary, they can be inlined and ideally add no overhead. I think this easily outweighs the cases where you need slow shared pointers.