Browse DevX
Sign up for e-mail newsletters from DevX

Search the Tips


1-20 of 64     Previous     Next
Do Not Assume SimpleDateFormat Is Thread-safe
by Octavia Anghel
Language: Java, Level: Beginner: - Learn why it is important to remember that sharing a SimpleDateFormat requires proper synchronization.
Obtaining a Thread Dump of Your Java App in Linux
by M S Sridhar
Language: Java, Expertise: Intermediate - Learn how to trigger a thread dump in Java on Linux os.
Launching an Asynchronous Operation Using BackgroundWorker
by Jayadev D
The .NET BackgroundWorker class makes it a snap to launch asynchronous operations on a separate thread.
Using the OneWay Web Service Attribute
by Srinath MS
When you call a void web service method, apply the OneWay attribute to avoid having the calling thread wait for a response.
Using Templates for Concurrent XSLT Transformations
by Leonard Anghel
Use Templates to use a Transformer object (from the TrAX API) in multiple threads running concurrently.
Multi-Threading: When printf Can Be Better than cout
by John Hendrix
printf and fprintf are much less likely to be preempted in the middle of streaming data.
Using CreateProcess Instead of _tspawnl to Spawn Programs
by Alison Lomaka
Using _tspawnl to spawn programs can have undesirable side effects. Learn how to avoid them.
A Safe Way to Stop a Java Thread
by Kevin Spiteri
The Thread.stop() method is unsafe and thus deprecated.
A C++ Mutex Operation for Intel-compatible Processors
by Andrei Borac
Interprocess synchronization has always been classified as a "slow" operation, but that is largely only because the Windows implementation requires switching to kernel mode (an expensive operation) each time you attempt to acquire a mutex.
Executing a Subprocess
by Lundholm Per
When executing a subprocess in Java, remember to read both the stdout and stderr from the process or it may be blocked.
Threads and ThreadGroups
by Navneet Gupta
Every Java thread is a member of a
by Rajesh Chathapuram
PostThreadMessage is a Win32 API used to post messages to threads. Usually, the message posted is a standard windows message with the window handle set to NULL.
How to Share a Handle Between Two Threads
by Rajesh Chathapuram
Whenever a handle is passed to another thread, use the DuplicateHandle ...
Making a Thread-Safe or Synchronized Collection
by Shantanu Garg
As you know by now, the commonly used collection classes, such as java.util.ArrayList, are not synchronized. However, if there's a chance that two threads could be altering a collection ...
Accessing Class Members From the Static Member Function
by Rajesh Chathapuram
When a class has Thread entry functions, it is usually declared as static member functions of the class as in the example ...
Take Control of the Threads Created By a Program
by Shantanu Garg
Whenever a thread is created in a program, it is unknown when it will execute. This means there may be cases where the parent program has finished but the thread is still executing. One way to ...
Portable Locks
by Danny Kalev
Sometimes you need to make sure that only one instance of the same application can run at any given time. Although every platform defines different locking schemes, you can use the following ...
Threads and JDBC Connections
by DevX Pro
Is the JDBC Connection class thread safe? In other words, can a connection be shared between multiple threads without using synchronization?
Synchronized Method Overhead
by DevX Pro
I am interested in keeping my code running as fast as possible. Is there a cost associated with making my methods synchronized, and if so, how significant a cost?
Threading and SimpleDateFormat
by DevX Pro
Is SimpleDateFormat threadsafe? I am trying to track down a bug where a date formatted "yyyy-MM-dd" actually came out as 2000-06-0001. I have four threads accessing the format method of my date formatter class at approximately the same time.
1-20 of 64     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date