multi-thread safe porting