web: improve threading