udan11 / samp-plugin-sql

An abstract layer that communicates with multiple database servers (MySQL and PostgreSQL) implemented as a plugin for SA-MP servers.
BSD 2-Clause "Simplified" License
16 stars 13 forks source link

Lock-free thread communications. #2

Closed Y-Less closed 11 years ago

Y-Less commented 11 years ago

I know you were looking for a lock-free map implementation, but I've done this with queues anyway as I don't know of another implementation. This now separates out threaded and non-threaded queries and actually runs a separate thread for EVERY SQL connection, not just one for them all. (seems far saner in the case of two different engines at the least).

udan11 commented 11 years ago

What do you think about concurrent_unordered_map?

Y-Less commented 11 years ago

Possibly, assuming you can lock it for erasing items - seems like the only downside.

udan11 commented 11 years ago

I read your code and I found some minor problems. I merged the code manually, fixing those issues. I'll commit the source soon. Thank you!