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

  • Home
  • SEARCH
  • 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 8711093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:47:18+00:00 2026-06-13T04:47:18+00:00

Would like to lock an external resource, in this case it will be a

  • 0

Would like to “lock” an external resource, in this case it will be a “blob” stored on rackspace cloud servers, similar so Amazon S3. (Using Python)

Would like a race condition to be handled like this:

  • First process creates lock on resource
  • First process begins editing resource
  • Second process attempts to edit the same resource and finds that the resource is locked.
  • Second process requests to be notified when the lock is taken off
  • First process finishes editing the resource and removes the lock
  • Second process receives the notification of the freed resource and is able to make its own edits

Would like to use Memcached or Redis to create the lock, however a different mechanism would be fine as well.

Most of this is pretty simple, the part I am struggling with is how to notify the second process when the lock is removed as opposed to forcing it to wait and retry.

Redis has publish / subscribe functionality, would this be appropriate to use in this situation?

Or is there some other way that I should go about solving this problem?

Thanks so much!

  • 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-06-13T04:47:19+00:00Added an answer on June 13, 2026 at 4:47 am

    As for Redis, in case you really need to have locking, you can use SETNX to create such a lock, more information can be found in SETNX documentation.

    If you expect low contention for the given lock and also you don’t have any resource hungry processing for the locked information you can also use WATCH/MULTI/EXEC transactions. First you set WATCH on the key you want to edit, then in MULTI you edit the key itself and then finally after EXEC, it either fails the edit because someone meanwhile edited that watched key (and you then need to retry) or it return OK and you are fine. This is how you implement opportunistic locking in Redis. More info in transaction documentation

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

Sidebar

Related Questions

I would like to lock the mouse inside a JFrame. That is, the mouse
Would like to make anapplication in Java that will not automatically parse parameters used
I know there are lots of similar questions out there like this, but all
I would like to change the Windows 8 Lock Screen background image via c#
I would like to have my app available to launch from the lock screen
I would like to 'lock' the mouse into a specific Y coordinate on the
I have an object that I would like to lock. class TestObj { Lock
There is this DB-connection-like object that my web application will need. It is pretty
I would like to create lock only once when map is initialized. Here is
I would like to create an exception handler for the specific case that happens

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.