answersLogoWhite

0

What is an atomic operation?

Updated: 11/2/2022
User Avatar

Wiki User

15y ago

Best Answer

An atomic operation is an operation which is guaranteed to finish in a single unit of time. This is important in synchronization where multiple threads may be trying to access a single variable at the same time.

Theoretically, a situation could occur as follows: Imagine two threads are both running the same code.

int c = 0;

void f() {

c = c + 1;

}

Now assume the following sequence of events takes place:

# Thread0 calls f() # Thread1 calls f() # Thread0 reads c as 0 # Thread1 reads c as 0 # Thread0 increases c to 1 # Thread1 increases c to 1 # Thread0 writes back c as 1 # Thread1 writes back c as 1

We end up with c = 1. This is obviously not what was supposed to happen. Each thread was supposed to execute the code once and increase c by one, ending up with c = 2. If the (c = c + 1) statement had been atomic, each thread would read, increment, and write back c before execution was passed to any other thread.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is an atomic operation?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Where can I obtain instructions for the operation of a Atomic clock?

http://www.lacrossetechnology.com/8117it/manual.pdf This has the instructions for your atomic clock.


What is operation Trinity?

Trinity was the code name for the explosion of the first atomic bomb in New Mexico in 1945.


What is microoperation?

Microoperations are fundamental operations that can be performed by a digital computer's control unit at a very basic level, usually involving simple data manipulation or transfer tasks. These operations form the building blocks for more complex instructions and tasks executed by a computer's central processing unit (CPU). They are essential for controlling the flow of data and instructions within a computer's architecture.


What 2 cities in what country had atomic bombs dropped on them during Pacific of Asian Theatre of operation?

Hiroshima and Nagasaki.


What is an atomic clock?

An atomic clock is a reference clock whose operation is based on an atomic process, such as the frequency of electromagnetic radiation associated with a specific energy-level transition in an element such as caesium.


What would have happened if the U.S. did not drop the atomic bomb?

The US would have invaded Japan on 01 Nov 45 Operation: DOWNFALL.


What would have happened if the US had not invented the atomic bomb?

The US would have invaded Japan on 01 Nov 45 Operation: DOWNFALL and fought until victory.


How long did it take to make all three atomic bombs?

As of august 1945 the US had the industrial capacity to make 3 atomic bombs a month. In november 1945 this would increase to 7 atomic bombs a month. As Japan surrendered before this, the US scaled back production and had only made 9 atomic bombs by the end of Operation Crossroads in the summer of 1946, five of which had been detonated.


What was operation Aurora 1945?

operation aurora 1945 was a suicide mission taking place in japan before the atomic bomb went off HOWEVER it is the first mission of BFBC2 in te begin it says it really happened that day and NO the russains did not take over south america


Did operation cardinal ever happen?

"Operation Cardinal" happened. The details of an OSS operation in Mukden, Manchuria, shortly after the surrender of Japan is detailed in an article by Peter Clemens entitled, "Operation Cardinal: The OSS in Manchuria, August 1945." It was published in a journal called Intelligence and National Security (Vol. 13, No. , Winter 1998) Hal Leith, the Russian/Chinese linguist on the mission, is alive and well. I think the questioner is confusing Operation Cardinal with Operation Downfall which was planned for (I believe) November 1945. After the two atomic bombs were dropped on Hiroshima and Nagasaki, and the surrender of Japan less than a week later, Operation Downfall became unnecessary.


How would events have played out without the atomic bombs?

Operation Olympic would have taken place; the invasion of Japan. Scheduled for late 1945. WWII may have lasted until 1946 or 1947.


How many atomic bombs did US have in 1946?

By the end of Operation Crossroads in the summer of 1946, the US had built a total of 9 atomic bombs and detonated 5 of them, leaving only 4 in the stockpile. Records obtained by the Bulletin of the Atomic Scientists suggest that by the end of 1946 the US had built 5 more atomic bombs, ending the year with 9 in the stockpile.While the Hanford reactors had a design capacity of 3 atomic bomb cores every month, its very obvious that they were being operated far below capacity through 1945 and 1946 to minimize neutron irradiation damage to the graphite moderator and/or shutdown for repairs frequently.