Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Search the Tips

Threading - Page 3

41-60 of 64     Previous     Next
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.
Thread Timing
by DevX Pro
How can I determine the total time it takes for a set of threads to execute?
Event Thread and Painting
by Brett Spell
Java uses the event thread to notify listeners of events by making calls to methods such as actionPerformed() and itemStateChanged(). However, this same thread is also responsible for repainting ...
Pass Data Between Threads Using Piped Streams
by Ajit Sagar
These "piped stream" classes allow your program to read data into an input stream and write it out through an output stream in a single method call.
A Runnable Is Not a Thread
by Behrouz Fallahi
You may come across some situations where implementing a Runnable may have some advantages over extending Thread. If the class you are going to multi-thread is already extending another class, you ...
Starting a Thread Using the Thread Class or the Runnable Interface
by Ajit Sagar
You can start a thread in Java by either implementing the java.lang.Runnable interface or by extending the java.lang.Thread class (see Tip
C++ and Multithreading
by Danny Kalev
Standard C++ does not directly address the issue of multiprocessing, threads, and thread safety. This issue is implementation dependent, which enables vendors to decide whether or not to provide ...
Weaving Threads
by Ajit Sagar
Java provides two ways to create and run a thread. You can implement the Runnable interface or extend the Thread class. The Runnable interface defines a single method run(). Consider the following ...
DHTML Window Redraw
by DevX Pro
Is there any way to control the redrawing/repainting of the open window/document? Specifically, I have to change page elements (labels, cursor style) before calling some time intensive task. I have successfully implemented changes to the cursor style but it doesn't always change the display of the mouse cursor immediately.
Delaying a Program
by DevX Pro
Can you please tell me how to delay the program flow in Java? I can't find any implementation of delay().
Splash Page Creation
by DevX Pro
I would like to show a splash page and have it time out after approximately five seconds. How do I do that?
Java Threads and Multiple Processors
by DevX Pro
On a Windows NT box with multiple processors, will a multithreaded Java application get split between the processors automatically?
Object passing between threads
by DevX Pro
Am implementing a network simulation program that requires a sender and receiver thread, with a frame object being passed between the two threads. Could you suggest a way of connecting the threads by means of an object stream that would allow the object to be passed between the two threads. What is required is much like the pipe implementation in c except from what I gather in java the data types that can be sent are limited.
Java Pausing Abilities
by DevX Pro
I want to make my Java program pause for a specified amount of time, but I don't want to use a threading implementation. How can I do this?
Multithreading Applets—the Right Way
by Paul Tyma
The canonical design of multithreaded applets is inherently flawed. You know what I'm talking about: the run method with the repaint/sleep statements embedded in a while(true). Any self-respecting ...
How to kill/dispose of applet thread when you leave page
by DevX Pro
I have an applet placed on successive pages that displays different information on each page (a text-scrolling applet). This applet is running on a thread. Is there a way to kill or dispose of this thread when you leave the page on which it was created? I have noticed that from time to time that when I quit using the browser, I can still see the applet scrolling across until Netscape completely disposes of all its memory.
by DevX Pro
I recently took Sun's Certified Java Programmers Exam and I ran into a few questions from the exam I'd like to ask you. What is the difference between >> and >>>? For example let's say you have: int x = 64; what is x >> 4? what is x >>> 4? I get 4 for both. What can be said about garbage collection? Select all true statements: a. It will be done so that your program will never run out of memory (within reason). b.It happens at predictable times. c.You can flag an object for collection. d.You can call a method to have an object explicitly collected. Under which circumstance would a thread stop execution? Select all true statements: a.A thread with a higher priority becomes run-able. b.The priority of the running thread is changed. c.Thread objects of the same class terminates. If you have an object and then you set it to null: SomeObject ob = new SomeObject(); ob = null; after you set ob to null, is the object available for garbage collection?
Difference between yield() and sleep()
by DevX Pro
What is the difference between calling yield() and sleep()? Also, in what instances would you call either method?
Why Does Spawned Thread Work on PC and not Sun?
by DevX Pro
This may be too vague, but: I spawn a thread (after a button click) which brings up a new window. This works great on my PC running Netscape 3.0 and Internet Explorer, but it doesn't work on a Sun (Netscape 3.0). I've also tried it on another PC running Internet Explorer and it didn't work there, either. Any clues?
41-60 of 64     Previous     Next
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date