⚡ Sangsakala Proxy 🏠 Home
Skip to content

Make PyGreSQL thread-safe on the connection level #16

Open

Description

@Cito

Check whether the treadsafety of PyGreSQL can/should be improved.

(copied from Trac ticket 24, created 2010-09-12)

Activity

  1. Cito commented on Feb 15, 2020

    @Cito
    MemberAuthor

    f we want to go from module level to connection level thread-safety, we need to introduce a connection lock or mutex and wrap all the critical parts in the pgdb connection methods and the underlying C code source object methods.

    We will need much better tests, including stress tests of the various connection methods with many threads that fail without the locks, before we could confidently claim to have threadsafety=2.
    It's certainly doable, but a hard nut to crack that requires much effort.

    Before deciding to tackle this, we should also collect some usage examples where threadsafety=2 would be important. When used with a web framework for instance, you usually have a thread-safe connection pool (e.g. provided by SQLAlchemy or DBUtils) and normally use a connection only within a single thread anyway.

    (copied from Trac)

  2. modified the milestone: 5.2 on Feb 15, 2020
  3. added this to the 7.0 milestone on Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions