- use select to obtain context in threads