Thread affinity

Improves performance by a few percent.