Thread library suitable to be used in conjunction with Erlang port drivers