What is AtomicInteger in Java and it’s working

The AtomicInteger class  added in Java 5 in java.util.concurrent.atomic package. The AtomicInteger class provide way to perform atomic operation on int values. Its supports lock-free and thread-safe programming on single variables.The AtomicInteger class is wrapper class for int values which allows operations on it Atomically. Atomic operations are performed as a single unit of task without interference of other […]

Continue Reading

Busy Spinning or Busy wait in multi-threading

Busy spinning or busy wait is a technique in a multi-threaded environment, where other threads loop continuously waiting for a thread to complete its task and signal them to start. When one thread loops continuously waiting for another thread to signal. This technique can be used whenever there is requirement to execute second thread (say ConsumerThread) […]

Continue Reading