I have a function that you can pass the targeted sqlite database and query information, and it executes that query. This function will be used concurrently in goroutines. The sqlite package I'm using is mattn's (https://github.com/mattn/go-sqlite3). It specifically says that it does not support concurrent access. Using a simple mutex.lock would be easy, if I only used one database (file); however, I need the function to take in a string variable that is the file path of the database to open. I don't want that function to lock itself in general, if two separate database files are being used (because then concurrency wouldn't matter, as it's two completely different database files).
What I'm getting at, is how would go about doing something like this? Make the lock FILE/DATABASE dependent in the same function, and only lock that specific resource (not the function... so that another goroutine can call and use it for another database if that specific database that was passed isn't already used)? I can't use maps, because those are not concurrent safe either. I hope I've explained myself. Any assistance would be highly appreciated... -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.