Threads Section Index | Page 4
Where can I learn (more) about Java development tools?
Check out the jGuru Tools FAQ.
Where can I learn (more) about Java networking capabilities?
Check out the jGuru
Networking FAQ.
Where can I learn (more) about Java's support for developing multi-threaded programs?
Check out the jGuru Threads
FAQ.
Where can I learn (more) about the Java programming language syntax and semantics?
Check out the
jGuru JavaLanguage FAQ.
If an event handler throws an exception which it does not itself catch, there is a crash in the current EventQueue DispatchThread.
If an event handler throws an exception which it does not itself catch, there is a crash in the current EventQueue DispatchThread.
It is impractical to put a try-catch around every possible event...more
Are there any good tutorials on Java Threads?
Bruce Eckel's Java book(Thinking in Java) can be downloaded freely from his site : http://www.bruceeckel.com
This book's thread section may be helpful for you.more
How can I find out how much CPU is taken by each JVM thread ?
Java Tip 92 at JavaWorld describes how to use the JVM Profiling Interface to get accurate timing information on a per-thread basis. The technique requires a small amount of native code, but it wil...more
How do I pass a variable into a thread that can be accessed from the run() method?
Create a subclass of Thread with a custom instance variable and initialize it in the constructor. (This is basic object-oriented programming design, BTW.)
For instance, to pass in a PrintWriter ...more
What is the difference between sleep and yield?
yield() tells the JVM Thread Scheduler that it's OK to give other threads time slices. Usually the JVM uses this call to activate another thread of the same thread priority. In a good preemptive...more
Why do I have to call System.exit() from my main method?
Unfortunately, certain system threads are started as regular threads, not daemon threads. One example is the AWT thread. That means that if your app opens a window, then even if that window is clo...more
How can I discover the current process ID from Java?
[When analyzing logs that our Java servlet creates, it would be nice
to be able to determine the process
id of the underlying Java process
that was running at the time. In
most operating systems...more
Is there any method by which I can join() to a group of threads instead of a single one?
Yes. Just join to each one in turn. That way, when the loop exits, you know that all the threads have exited -- whether it was the first thread or the seventh thread that took the longest, all thr...more
What is the difference between "Green Threads" and "Native Threads" ?
"Green Threads" are the default threads that are provided in the JDK, while the "Native Threads" are the one provided by the native Operating System.
Normally "Native Thre...more
Why does Java prohibit the use of "synchronized" on a constructor?
[I'm unclear about constructors in general, and how they relate to multithreading in particular. Common advice is to make member variables (instance and static) private and synchronize public meth...more
Is there anything special that needs to be done in order to get the JVM to work efficiently with multiple CPUs on a Windows NT (4.0) machine?
[We are currently using the standard VM that comes with the Java 2 JDK. When we run the VM on a multi-processor (e.g., 2 cpus), Windows NT-based, computer, we notice that one CPU hovers around 20...more