java.util.concurrent « concurrency « Java Thread Q&A

Home
Java Thread Q&A
1.concurrency
2.Development
3.Exception
4.Notify
5.Operation
6.Socket
7.State
8.synchronize
9.Thread Safe
10.ThreadPool
Java Thread Q&A » concurrency » java.util.concurrent 

1. Overview / Tutorial on moving from dl.util.concurrent to java.util.concurrent    stackoverflow.com

We have been using Doug Lea's concurrent library for more than 8 years now. For backwards compatibility reasons our code was restricted to use Java 2 language level and JDK 1.3 ...

2. What is the .NET equivalent of Java's java.util.concurrent package?    stackoverflow.com

I come from a Java background. I am wanting to learn more about concurrency in .Net and C#. Is there something similar to Java's concurrent utils package?

3. C++ Equivalent java.util.concurrent.ArrayBlockingQueue    stackoverflow.com

May I know is there any C++ equivalent class, to Java java.util.concurrent.ArrayBlockingQueue http://download.java.net/jdk7/docs/api/java/util/concurrent/ArrayBlockingQueue.html

4. Long primitive or AtomicLong for a counter?    stackoverflow.com

I have a need for a counter of type long with the following requirements/facts:

  • Incrementing the counter should take as little time as possible.
  • The counter will only be written to by one ...

5. ConcurrentLinkedQueue$Node remains in heap after remove()    stackoverflow.com

I have a multithreaded app writing and reading a ConcurrentLinkedQueue, which is conceptually used to back entries in a list/table. I originally used a ConcurrentHashMap for this, which worked well. ...

6. ScheduledThreadPoolExecutor executing a wrong time because of CPU time discrepancy    stackoverflow.com

I'm scheduling a task using a ScheduledThreadPoolExecutor object. I use the following method:

public ScheduledFuture<?> schedule(Runnable command, long delay,TimeUnit unit) 
and set the delay to 30 seconds (delay = 30,000 and ...

7. Inconsistency in java.util.concurrent.Future?    stackoverflow.com

For the sake of argument, let's say I'm implementing Future for a task which is not cancelable. The Java 6 API doc says:

After [cancel()] returns, subsequent ...

8. Guava MapMaker().weakKeys().makeMap() vs WeakHashMap    stackoverflow.com

We have a Scala server that is getting a node tree using Protocol Buffers over a socket and we need to attach additional data to each node. In a single threaded context ...

9. java.util.concurrent.RejectedExecutionException in TCP_NIO , JGroups    stackoverflow.com

What does it mean, and more important how to avoid that? My nio config is in the bottom

java.util.concurrent.RejectedExecutionException
    at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
    at org.jgroups.util.ShutdownRejectedExecutionHandler.rejectedExecution(ShutdownRejectedExecutionHandler.java:34)
    at ...

10. java.util.concurrent code review    stackoverflow.com

I'm study java.util.concurrent library and find many infinite loops in the source code, like this one

//java.util.concurrent.atomic.AtomicInteger by Doug Lea
public final int getAndSet(int newValue) {
    for (;;) {
  ...

11. Active Object Pattern in Concurrent Java 1.5+    stackoverflow.com

I am trying to develop active object pattern in concurrent Java using java.util.concurrent classes. I describe it using a Client and a Server. A sample Server is as:

class Server implements ...

12. is there any Concurrent LinkedHashSet in JDK6.0 or other libraries?    stackoverflow.com

my code throw follow exception:

java.util.ConcurrentModificationException
        at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:761)
        at java.util.LinkedList$ListItr.next(LinkedList.java:696)
        at ...

13. Is there a Mutex in Java?    stackoverflow.com

Is there a Mutex object in java or a way to create one? I am asking because a Semaphore object initialized with 1 permit does not help me. Think of this case:

try {
 ...

14. Memory consistancy in java.util.concurrent    stackoverflow.com

From Memory Consistancy Property, we know that: "Actions in a thread prior to placing an object into any concurrent collection happen-before actions subsequent to the access or removal of that ...

15. Trade offs between using Java's built in concurency mechanism versus Utilities provided in java.util.concurrent    stackoverflow.com

What are the trade offs between using Java's built in concurency mechanism versus utilities (like ReentrantLocks for example) provided in java.util.concurrent

16. how do you "ignore" java.util.concurrent.Future objects?    stackoverflow.com

Can you spot the bug? This will throw an java.lang.OutOfMemoryError.

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class TestTheads {

    public static void main(String[] args) {

       ...

17. Manipulate Thread Implementation in JVM    stackoverflow.com

Recently, I've been working on the deployment of concurrent objects onto multicore. In a sample, I use BlockingQueue.take() method whose specification mentions that it is blocking. It means that ...

18. why CountDownLatch.getCount() returns a long but not an int?    stackoverflow.com

I looked into the code, everything is int -- the parameter passed to CountDownLatch constructor is int, the variable in Sync is int, the return type of Sync.getCount() is int. But ...

19. Looking for an unbounded, queue-based, concurrent implementation of java.util.Set    stackoverflow.com

I'm looking for an implementation of java.util.Set with the following features:

  1. Should be concurrent by no means of synchronized locking; So it's obvious that I don't want to use Collections.synchronizedSet().
  2. Should ...

20. Why is there no "awaitTermination(Date deadline)" method?    stackoverflow.com

I have a list of tasks submitted to an ExecutorService. But I need to shutdown the ExecutorService before a deadline of 2:30AM, even if the tasks are not finished. How can ...

21. Java Concurrency: how to get the worker thread's response asynchronously    stackoverflow.com

I am new to java.util.concurrent package. I'm trying to write some samples. Here is my some sample code snippet:

for (MyTask task : tasks) { 
Future<Boolean> result = task.getResult();
try {
   ...

22. Java Concurrency: Can I create a pool using worker thread    stackoverflow.com

I'm new to java.uti.concurrent package. I'm trying to develop a socket listner class by using ExecutorService. Here is my Main code snippet:

    while (!getExit()) {

    ...

23. Scheduling a Callable at a fixed rate    stackoverflow.com

I have a task that I want to run at a fixed rate. However I also need the result of the task after each execution. Here is what I tried: The task

class ...

24. Handling java.util.concurrent.Future with null result    stackoverflow.com

If I submit task, and futureTask.get() returns null, I would like to process what I sent in the Callable object another way. When debugging, I can see that my Future ...

25. How does java.util.concurrent.RecursiveTask work?    stackoverflow.com

could anyone tell me the logic behind java.util.concurrent.RecursiveTask? I couldn't find the source code either on a very cursory look, so maybe someone can point me to it as well? Thanks. ...

26. How can I serialize thread handling with Java 5's java.util.concurrent package?    coderanch.com

Originally posted by Jim Yingst: I don't think I really understand your true goals here. That is, exact control of all aspects of the order such as you originally described is probably not practical or even possible, but partial control may be. You haven't explained your goals enough to say whether that will be acceptable. Why do you need to execute ...

27. java.util.concurrent and performance    coderanch.com

I've been trying to understand some of the new features of java.util.concurrent and I'm getting somewhat confused. I created a basic class to represent a bank account, with simple methods to check the balance and withdraw. I then wrote three test classes. Each class ran ten threads sharing a common account; each thread would check the balance and, if it was ...

28. java.util.concurrent Package    coderanch.com

Hi Currently we're working on a standalone java engine to process billing for customers. The EA has decided to use Command pattern and a command factory which upon receiving messages is supposed to create a new command and submit it to an ExecutorService object to queue it, so it would be run by one of the worker threads in the pool. ...

29. java.util.concurrent.Future    coderanch.com

31. java.util.concurrent Thread Management    coderanch.com

32. java.util.concurrent package    coderanch.com

Hi, I am working on enhancing a project developed some time ago and none of the people that worked on it are there now! There is a package java.util.concurrent that is used, but the JRE 1.4 does not have it. I tried upgrading to JRE 6 but even then I get the same error saying that particular package (and associated classes ...

34. Synchronising java.util.concurrent    forums.oracle.com

I am sure you have considered the following arguments already, I'll list them anyway: Synchronization concerns some form of locking and acquiring more than one lock is error prone (when less than genious-type devs are involved), it's therefore wise to avoid acquiring a lock if unecessary and thus reduce chances of deadlocks and other bugs. This is probably the reasoning for ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.