Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7653049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:55:38+00:00 2026-05-31T11:55:38+00:00

I am using pyhton’s multiprocessing package in a standard client-server model. I have a

  • 0

I am using pyhton’s multiprocessing package in a standard client-server model.
I have a few types of objects in the server that I register through the BaseManager.register method, and use from the client through proxies (based on the AutoProxy class).

I’ve had random errors pop up when I was using those proxies from multiple client threads, and following some reading I discovered that the Proxy instances themselves are not thread safe. See from the python multiprocessing documentation:

Thread safety of proxies
Do not use a proxy object from more than one thread unless you protect it with a lock.
(There is never a problem with different processes using the same proxy.)

My scenario fits this perfectly then. OK, I know why it fails. But I want it to work 🙂 so I seek an advice – what is the best method to make this thread-safe?
My particular case being that (a) I work with a single client thread 90% of the time, (b) the actual objects behind the proxy are thread safe, and (c) that I would like to call multiple methods of the same proxied-object concurrently.

As always, Internet, those who help me shall live on and never die! Those who do their best might get a consolation prize too.

Thanks,
Yonatan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:55:39+00:00Added an answer on May 31, 2026 at 11:55 am

    Unfortunately, this issue probably doesn’t relate to too many people 🙁

    Here’s what we’re doing, for future readers:

    • We’ll be using regular thread locks to guard usage of the ‘main’ proxy
    • The main proxy provides proxies to other instances in the server process, and these are thread-specific in our contexts, so we’ll be using those without a lock

    Not a very interesting solution, yeah, I know. We also considered making a tailored version of the AutoProxy (the package supports that) with built-in locking. We might do that if this scenario repeats in our system. Auto-locking should be done carefully, since this is done ‘behind the scenes’ and can lead to race-condition deadlocks.

    If anyone has similar issues in the future – please comment or contact me directly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using Python is it possible that a dict can have a value that
Using Python v2.x, I have 3 variables that I want to ask the user
Using Python 2.7 Situation: I have some piece of Python code (that the user
(Using Python 3.2, though I doubt it matters.) I have class Data , class
I'm using Python v2.6 and I have a string which contains a number of
I am using Python and have to work on following scenario using Hadoop Streaming:
I'm using Python 2.7. Let's say I have a list like so: string_list =
I'm new in using Python - Arcmap. I have on my map a list
Using Python I want to create a symbolic link pointing to a path that
using python 2.6.5 and python-ldap 2.3.10, I have the following problem: Under certain circumstances

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.