colorify.js

C++ Nuggets - My little array class

Sometimes I need to store a little collection of something. I usually use a C-style array and an accompanying length variable. This is very handy - it's fast to implement, works very fast as there are no allocations, minimal amount of pointer dereferences, and no redundant pieces.

Fiddling with thread stacks

So, you want to mess with threads' stack? it's a bit hard to find meaningful online examples. All you find are some trivial examples of calling pthread_attr_setstack and some guys asking why on earth you want to do that, and telling you that's a sign of bad design and such.
There can be a few reasons for setting stack size, stack address, and protector page size.