Code Monkey home page Code Monkey logo

Comments (6)

coleifer avatar coleifer commented on June 1, 2024

Is an error or something happening?

For what it's worthy, if you're trying to parallel-ize the actual updating of the database, I don't think you're going to see any benefit over single-threaded. UnQLite is embedded in the Python process and there's no socket I/O operations that would make for good places to do context-switching.

from unqlite-python.

coleifer avatar coleifer commented on June 1, 2024

It looks like UnQLite is not thread-safe by default. Check out the "Compile-Time Options" section of the docs:

https://unqlite.org/c_api_const.html

from unqlite-python.

avocadochicken avatar avocadochicken commented on June 1, 2024

My posted code runs without any unhandled exception thrown. I guess there is no error, but there is no update at all, i.e. not a single database entry gets updated.
I choose this DB, because http://unqlite-python.readthedocs.io/en/latest/index.html states it is thread safe. I need several hundred / thousands concurrent threads. It is not about the speed up, but about different connections that receive timeouts/data on different times.

from unqlite-python.

coleifer avatar coleifer commented on June 1, 2024

You're best off probably using a single dedicated thread for writing to the UnQLite database. You can use a queue to have the worker threads push updates to the writer thread...I think that will probably work much better for you.

from unqlite-python.

avocadochicken avatar avocadochicken commented on June 1, 2024

Of course.
Maybe the thread safety info should be removed from the docs?

from unqlite-python.

coleifer avatar coleifer commented on June 1, 2024

I pulled it right from the UnQLite official document on their homepage. It says thread-safe and fully re-entrant. I've created an issue symisc/unqlite#71 which should hopefully clarify.

from unqlite-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.