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 9236457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:17:50+00:00 2026-06-18T07:17:50+00:00

My doubt: if there is a way by which we can ensure that a

  • 0

My doubt: if there is a way by which we can ensure that a series of statements are executed in an atomic way. But one thing is sure that we don’t need to use locks. So, is there any elegant way of doing it. For example I need to do the same in php.
For Example:
Statements to be executed:

  1. Fetch a key from APC cache.
  2. Do some operation on that.. let us say increment it.
  3. Save that to the Cache again.

I need it to do these things atomic because at a time many processes can update the same thing.

Thanks,
Varun

  • 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-18T07:17:52+00:00Added an answer on June 18, 2026 at 7:17 am

    Locks, Mutexes, Semaphores have all been invented for guaranteeing atomicity in multitasking/parallel computers.

    There are ways to optimize locking: the worst you can do is busy-waiting in a loop for a resource to be ready; while better solutions involve signaling/queuing to acquire a resource.

    It should be clear at this point that there’s not a lot you can do to achieve atomicity without locking, expecially when there are more than one instruction in execution in a moment in time, even in a single CPU core (it’s called pipelining).

    That said, this has been asked before here: APC caching and atomic operations

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

Sidebar

Related Questions

Is there a way in Perl to declare that a method can throw an
I doubt there is, but I was just wondering if I can apply a
I have a general doubt .. Is there a way we limit the scope
I had this doubt for sometime now, some people say that there's no such
I am just a beginner in cruise control.NET.My doubt is that is there any
I have the following code snippet in QML, but I doubt statements inside Repeater
I have a doubt regarding unions. Suppose there is a union defined as union
My program/process exited abnormally? I doubt something is wrong with the following code: There
I haven't browsed through the spec, though I doubt any info is in there.
i'm new at Android world, and i have a doubt, is there any method

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.