-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multithread issues #52
Comments
I think we can probably fix most of these issues by making the various dictionaries into concurrent ones. It seems best to aim for being able to share a context with multiple threads. (May even be able to look at making the dictionaries static as well) This is something on my to do list but I haven't got around to it yet. When I come to doing CRUD (soon) I will have to be a bit more careful, but for now the concurrent dictionaries should do the trick. Perhaps you could try it just in the MySQL one and see how we get on? Let me know of any other threaded problems you are having as well. Cheers, Ross |
In relation to issue fsprojects#52. Adding locks to the GetColumn calls that are used to preload the columns seems to solve the immediate thread safety issues I was hitting.
Well even simpler, I added locks around provider creating and the calls to GetColumns that were preloading the column data. Seems to of solved the immediate issue. |
In relation to issue fsprojects#52. Adding locks to the GetColumn calls that are used to preload the columns seems to solve the immediate thread safety issues I was hitting.
In relation to issue fsprojects#52. Adding locks to the GetColumn calls that are used to preload the columns seems to solve the immediate thread safety issues I was hitting.
In relation to issue fsprojects#52. Adding locks to the GetColumn calls that are used to preload the columns seems to solve the immediate thread safety issues I was hitting.
I've removed my locks workaround and updated to the latest SQLProvider (with CRUD support) and have not seen any thread issues yet. It's probably ok to close this. |
I re-implemented your locks with the new architecture, however there are likely going to be be threading issues with the initial CRUD stuff so I am leaving this open for now. |
Currently I'm running into issues where if I have one shared context or a context per method I'm hitting exceptional code paths (mostly trying to add things to dictionaries with a key that already exists). I'm happy to try and help fix this but I want to know what the expected behavior should be. Should you be able to use one context in multiple threads safely, or should you create a new context per thread or should you create a new context per thread but create the context while holding onto a lock for the type provider.
A) Context is thread safe:
B) Context creation is thread safe:
C) No thread safety
The text was updated successfully, but these errors were encountered: