added thread-affinity