Practical uses for AtomicInteger
I sort of understand that AtomicInteger and other Atomic variables allow concurrent accesses. In what cases is this class typically used though? 12 Answers 12
I sort of understand that AtomicInteger and other Atomic variables allow concurrent accesses. In what cases is this class typically used though? 12 Answers 12
Concurrency is having two tasks run in parallel on separate threads. However, asynchronous methods run in parallel but on the same 1 thread. How is this achieved? Also, what about parallelism? What are the differences between these 3 concepts? 15 Answers 15
How I can use AtomicBoolean and what is that class for? 5 Answers 5
Is it correct to say that static means one copy of the value for all objects and volatile means one copy of the value for all threads? Anyway a static variable value is also going to be one value for all threads, then why should we go for volatile? 8 Answers 8
I just watched the following video: Introduction to Node.js and still don’t understand how you get the speed benefits. Mainly, at one point Ryan Dahl (Node.js’ creator) says that Node.js is event-loop based instead of thread-based. Threads are expensive and should only be left to the experts of concurrent programming to be utilized. Later, he … Read more
What does AtomicBoolean do that a volatile boolean cannot achieve? 11 Answers 11
We all know that in order to invoke Object.wait(), this call must be placed in synchronized block, otherwise an IllegalMonitorStateException is thrown. But what’s the reason for making this restriction? I know that wait() releases the monitor, but why do we need to explicitly acquire the monitor by making particular block synchronized and then release … Read more
I know about the “cooperative” threading of ruby using green threads. How can I create real “OS-level” threads in my application in order to make use of multiple cpu cores for processing? 9 Answers 9
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 5 years ago. Improve this question Is Java Concurrency in Practice still valid? I am wondering whether the ideas, concepts and implementation described in the … Read more
How can I create a concurrent List instance, where I can access elements by index? Does the JDK have any classes or factory methods I can use? 8 Answers 8