Threading

I will call the next thread management code i make 'Loom'.