Threads Section Index | Page 4
Check out the jGuru Tools FAQ.
Check out the jGuru Networking FAQ.
Check out the jGuru Threads FAQ.
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
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
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
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
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
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
[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
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
"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
[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