add thread safe connector_write