Skip to content

Very ineffective threading #937

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

Closed
gentlee opened this issue Jun 7, 2019 · 3 comments
Closed

Very ineffective threading #937

gentlee opened this issue Jun 7, 2019 · 3 comments

Comments

@gentlee
Copy link

gentlee commented Jun 7, 2019

Your library is poorly written and definitely not lightweight because you create your own serial queue and perform all requests syncronously! Author of this lib doesn't understand multithreading and how things should be done.

You either leave synchronization for user so that he creates his own serial queue and decide if he want sync or async (and this is lightweight), or you create serial queue and make two versions for each function - sync and async.

Currently user will always block 2 threads, inner serial queue's thread and his own queue's thread that he uses not to block main one (or even main thread).

I would suggest to implement second approach not to break existing api.

@jberkel
Copy link
Collaborator

jberkel commented Aug 24, 2021

The point of the queue is not "effectiveness" but safety. And with SQLite most operations are so fast that you don't even need another queue/thread to avoid blocking the main thread. It's lightweight in the sense that the user does not have to deal with how the connection is accessed.

But yes, the whole thing could probably be rethought at some point.

@gentlee
Copy link
Author

gentlee commented Aug 24, 2021

@jberkel you don't understand what you are talking about. That explains a lot.

@jberkel
Copy link
Collaborator

jberkel commented Aug 24, 2021

Listen, nobody is forcing you to use this library. If you don't agree with the design, use something else, there are enough alternatives, or come up with something better yourself.

But it looks like you're not really interested in helping anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants