jGuru
Register Email     Password Forgot your
password?
HOME FAQS FORUMS DOWNLOADS ARTICLES PEERSCOPE LEARN

  Search   jGuru Search Help

View:
Threads FAQ Home Page

FAQ Manager is guru Brandon Rohlfs.

Learn to manage multiple tasks with threads from your Java programs. Find answers to your frequently asked questions.

What's New

What is the purpose of the CopyOnWriteArrayList and CopyOnWriteArraySet collections?
Java:API:Collections, Programming:Concepts:Threads
John Zukowski PREMIUM, Jun 30, 2006
Synchronized operations are costly and if you aren't modifying a collection much, it is best not to synchronize all collection accesses. The CopyOnWriteXXX...
What is the primary difference between pessimistic and optimistic concurrency control?
Programming:Concepts:Threads
John Zukowski PREMIUM, Mar 31, 2006
Pessimistic assumes conflicts will occur and avoids them through exclusive locks and explicit synchronization. With the optimistic approach, it is assumed...
How do I configure a default handler for exceptions that happen in all threads?
Java:Language:Exceptions, Programming:Concepts:Threads
John Zukowski PREMIUM, Jan 22, 2006
The setDefaultUncaughtExceptionHandler() method of Thread, introduced in JDK 5.0, allows you to configure this behavior by letting you attach an implementation...

How can I get the number of active Groups within a ThreadGroup?
Programming:Concepts:Threads
Brandon Rohlfs, Sep 23, 2005
ThreadGroups activeGroupCount() returns the number of active groups within the ThreadGroup instance it was called upon. Once the number of active groups...
What is a ThreadGroup?
Programming:Concepts:Threads
Brandon Rohlfs, Sep 21, 2005
A ThreadGroup is used to represent a group of Threads. A tree structure can be formed from ThreadsGroups containing other ThreadGroups. Threads can only...
What is a ThreadGroup?
Programming:Concepts:Threads
Brandon Rohlfs, Sep 21, 2005
A ThreadGroup is used to represent a group of Threads. A tree structure can be formed from ThreadsGroups containing other ThreadGroups. Threads can...
How can a Thread preempt another Thread?
Programming:Concepts:Threads
Brandon Rohlfs, Sep 20, 2005
Any Threads running within the JVM can be preempted by creating and starting a Thread which is of a higher priority. A Threads priority can be set...
What is a Thread identifer and how can I obtain it?
Programming:Concepts:Threads
Brandon Rohlfs, Sep 12, 2005
A Threads identifer is a positive unique long value which is generated when a Thread is created. Using the following method a Threads identifer can be...
Is there a way that I can get the number of threads currently executing within the JVM?
Programming:Concepts:Threads
Brandon Rohlfs, Aug 1, 2005
You can use activeCount() for this. activeCount() returns the number of active threads that are part of the current thread's thread group. static...
How can I tell the difference between wait(timeout) timing out and actually being notified?
Java:Language, Programming:Concepts:Threads
John Zukowski PREMIUM, Jul 31, 2005
You can't directly by using wait and notify, but the can use a similar construct with the Lock interface of the java.util.concurrent.locks package, with...
How can I create a thread pool?
Programming:Concepts:Threads
John Zukowski PREMIUM, Jul 31, 2005
The Executors class of the java.util.concurrent class offers newCachedThreadPool(), newCachedThreadPool(ThreadFactory threadFactory), newFixedThreadPool(int...
What purpose does the TimeUnit class have?
Java:Language, Programming:Concepts:Threads
John Zukowski PREMIUM, Jul 31, 2005
The TimeUnit class allows you to work with time quanities as both an amount and a unit of measurement. For instance, instead of always working with milliseconds...
How can i tell what state a thread is in?
Programming:Concepts:Threads
Brandon Rohlfs, Jul 14, 2005
Prior to Java 5, isAlive() was commonly used to test a threads state. If isAlive() returned false the thread was either new or terminated but there...
How can I determine if a thread is alive?
Programming:Concepts:Threads
Brandon Rohlfs, Jul 9, 2005
The thread class provides a method which can be called on an instance of a Thread to determine if it is currently executing. If isAlive() returns...
How can I create a daemon thread?
Programming:Concepts:Threads
Brandon Rohlfs, Jul 4, 2005
The Thread API allows Threads to be created which are at the mercy of their user threads. This is accomplished simply by passing true to the setDaemon()...
How do I configure a default handler for exceptions that happen in my threads?
Programming:Concepts:Threads
John Zukowski PREMIUM, Jun 30, 2005
The setUncaughtExceptionHandler() method of Thread, introduced in JDK 5.0, allows you to configure this behavior by letting you attach an implementation...
What happens if two threads perform a get of one hashmap at the same time?
Java:API:Collections, Programming:Concepts:Threads
Muruganantham Mani, Jan 21, 2003
[I know a HashMap object is not synchronized if not done explicitly, so in a case where you have to write and read data in a hashmap from different threads...
Is it possible to wake up a sleeping thread?
Programming:Concepts:Threads
G M PREMIUM, Dec 28, 2002
[I have a thread which is sleeping for a long period of time.Another object has the object of this sleeping thread. In some event , the second object...
Thread synchronization seems to work using a queue -- that the waiting threads will acquire the released lock in first-in, first-out order. Is this behavior reliable?
Programming:Concepts:Threads
Terry Laurenzo, Jan 14, 2002
Any ordering that you are observing is not mandated by the spec. It is therefore subject to change and should not be relied on (even using a multi-processor...
Is there an example of a chat server (aka Threaded Virtual Meeting Place) ?
Programming:Concepts:Threads, Java:API:Networking
Alex Chaffee PREMIUM, Dec 23, 2001
My Purple Server is an open-source chat server with applet and command-line clients. Building a Java chat server by Greg Travis IRC Bot Dreams Is...
« previous beginning next »


Ask A Question



Related Links

Threads Forum

Sun Tutorial: Doing Two or More Tasks at Once: Threads

Concurrent Programming in Java, Second Edition

Thread Method Deprecation

Wish List
Features
About jGuru
Contact Us

 


internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs