Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
Search the Tips

Threading - Page 2

21-40 of 62     Previous     Next
System Shutdown
by DevX Pro
Is there an API that I can use to sense that the system is shutting down?
Stopping Threads
by DevX Pro
How do you stop a Thread without using the stop() method?
Designing Applications for Symmetric Multiprocessing Environments
by Danny Kalev
Many modern operating systems support Symmetric Multiprocessing (SMP)—a hardware architecture that uses two or more processors on one machine and enables you to achieve true multitasking. On ...
Accessing an Object From Another Process
by Danny Kalev
On modern operating systems, a process consists of an executable file that the OS loads into the system's memory and executes. A process normally has an entry point and one or more exit points. The ...
AWT Thread Interaction
by DevX Pro
I have two threads in an application. Thread A displays a form and allows the user to interact with it, thread B executes a loop which continually retrieves data and updates the form object by executing a synchronized method in the form object. I first tried to code thread A to use the showDialog() method on the form object, then started thread a and then thread b. However, thread a starts and the form then waits to be closed before the statement starting thread b is executed. I then tried just using the show() method in thread a - this allows the start of thread b to execute but I lose my interaction with the form.
Volatile Semantics and Container Objects
by Danny Kalev
Volatile objects are used in multithreaded applications and applications that map hardware devices into registers. Although you can declare an STL container object with the volatile qualifier, you ...
Multithreading Misconceptions
by Danny Kalev
...
Force an Object to Destroy Itself
by Danny Kalev
Sometimes, you need to force an object to destroy itself because its destructor performs an operation needed immediately. For example, when you want to release a mutex or close a ...
Get all your Threads and Thread Groups
by Behrouz Fallahi
It might be useful to garner an enumeration of all thread groups and ...
Useful Thread Terminology
by Behrouz Fallahi
Java makes working with threads relatively straight forward. However, there are situations, or anomalies that can arise due to improper design of a thread-based code. The following provides you with ...
Conditional Semaphores
by DevX Pro
I am trying to create a queue that will be emptied by multiple threads simultaneously. In C/C++ this requires the use of a conditional semaphore to signal that the queue is empty/not empty. How can a Condition be implemented in Java?
Create Timer Threads Using the Swing Timer Class
by Ajit Sagar
The Swing package, which is now a standard API package in Java 2, offers a new timer utility. This utility is implicitly threaded and lets you create as many timer threads as required, while ...
Create a Timer Using the Static Sleep() Method
by Ajit Sagar
The simplest way to create a timer in Java is to use the static sleep() method on the Thread class. This code shows a main class that has a while loop for implementing the timer. The argument read ...
Get a Free Grip on the Output of the Process Object
by Behrouz Fallahi
There are times when you have to use the exec(...) method of java.lang.Runtime class to launch a program. For ...
Optimize Your Scripts in DHTML When Accessing a Collection
by Jai Bardhan
A typical operation in DHTML is to iterate through a collection of objects. Let's say you're writing an HTML application that indexes content. Your task is to collect all the H1 elements on a ...
Running Piped Threads
by Ajit Sagar
Each piped thread has a run() method, and in an application using piped streams, their run() methods are interdependent. These code excerpts illustrate the run() methods for a PipedInputStream ("in_") and a PipedOutputStream ("out_").
Threading Piped Streams
by Ajit Sagar
Though piped streams are typically used in separate threads, you can use this class to connect them together.
Using Piped Streams in an Application
by Ajit Sagar
Learn how to create and use the PipedInputStream and PipedOutputStream objects in separate classes and in separate threads.
Java Virtual Machine Doesn't Exit
by Brett Spell
You may have been surprised and frustrated to find that in some cases, the Java Virtual Machine (JVM) does not stop running when your application exits the static main() method. For ...
Connecting the Piped Stream Classes
by Ajit Sagar
The no-argument default constructors for the piped stream classes create streams that are not connected to any other stream. This code shows you how to connect them.
21-40 of 62     Previous     Next
Sitemap