add threading support at lower layer