i am wondering wheather the mongo c driver is thread safe or not ?
Hi Meiqi,
As mentioned in the API manual for MongoDB C Driver v1.3.x: Threading, the driver is thread unaware for most of its operations. It is up to the you to guarantee thread-safety. You could use the thread-safe mongoc_client_pool_t to retrieve a mongo_client_t for your thread.
Each thread hold a client created by mongoc_client_pool_pop to write and read.
If you are already using mongoc_client_pool_t, make sure that each mongo_client_t retrieved is being used only for that given thread.
Regards,
Wan.