abstract threading for windows / linux