Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners disadvantage of threads

Have Programming Question? Ask it here!
 
 
 


samar
disadvantage of threads
2 Answer(s)      3 years and 10 months ago
Posted in : Java Beginners


hello,

Can somebody tell me What is the disadvantage of threads?


Advertisement
View Answers

October 25, 2010 at 12:21 PM


hello,

The Main disadvantage of in threads these are operating system dependent.



October 25, 2010 at 6:43 PM


Hi,

Here is the detailed disadvantage of Threads.

Let?s discuss the disadvantages of threads.

  1. The global variables defined in the application is not thread safe and different thread can access the same variable at a same time. So, this can be disastrous. So, you are advised to put the global variable access code into synchronized{} block.

  2. Many java libraries are not thread safe. So, you should be very care full while using the such libraries in your application.

  3. Thread may crash your application. If in your application there is some problem in the thread and it crashes, it will crash your whole application.

  4. If due to memory leak if one thread is killed, the other threads using the same memory location will be killed automatically. This situation is disastrous to your application.

  5. Threads functioning is dependent on OS support.

  6. If threads in your program are executed serially it may increase the complexity.

  7. Thread consumes lot of resources, if you overuse it, it may degrade the performance of your application.

Thanks



Related Tutorials/Questions & Answers:
disadvantage of threads
disadvantage of threads  hello, Can somebody tell me What is the disadvantage of threads?   hello, The Main disadvantage of in threads... disadvantage of Threads. Let?s discuss the disadvantages of threads. The global
threads
threads  what are threads? what is the use in progarmming
Advertisements
threads in java
threads in java  how to read a file in java , split it and write into two different files using threads such that thread is running twice
threads and events
threads and events  Can you explain threads and events in java for me. Thank you.   Java Event Handling Java Thread Examples
Java threads
Java threads  What are the two basic ways in which classes that can be run as threads may be defined
Sync Threads
Sync Threads  "If two threads wants to execute a synchronized method in a class, and both threads are using the same instance of the class to invoke the method then only one thread can execute the method at a time." This is what
threads in java
threads in java  iam getting that the local variable is never read in eclipse in main classas:: class Synex4{ public static void main(String args[]){ Test1 ob1=new Test1(); //local variable never read
Threads in realtime projects
Threads in realtime projects  Explain where we use threads in realtime projects with example
Synchronized Threads
Synchronized Threads       In Java, the threads are executed independently to each other. These types of threads are called as asynchronous threads. But there are two problems may
Coding for life cycle in threads
Coding for life cycle in threads  program for life cycle in threads
Explain about threads:how to start program in threads?
Explain about threads:how to start program in threads?  import...; Learn Threads   Thread is a path of execution of a program... more than one thread. Every program has at least one thread. Threads are used
Examples on threads and mulithreading.....
Examples on threads and mulithreading.....  Is any good examples on threads and Mulithreading...   Hi Friend, Please visit the following link: Thread Tutorial Thanks
java threads - Java Beginners
java threads  What are the two basic ways in which classes that can be run as threads may be defined
Synchronized Threads
Synchronized Threads       In Java, the threads are executed independently to each other. These types of threads are called as asynchronous threads. But there are two problems may
Synchronized Threads
Synchronized Threads       In Java, the threads are executed independently to each other. These types of threads are called as asynchronous threads. But there are two problems may
threads in java - Java Beginners
threads in java  what is the difference between preemptive scheduling and time slicing?   hi friend, In Preemptive scheduling, a thread... or the priority of one of the waiting threads is increased. While in Time Slicing
Java Threads - Java Beginners
allows the threads to wait for resources to become available and also notify the thread that makes resource available to notify other threads
Daemon Threads
Daemon Threads       In Java, any thread can be a Daemon thread. Daemon threads are like a service providers for other threads or objects running in the same process as the daemon
Threads,Servlets - Java Beginners
Threads,Servlets  1)Is two Start mathods exist in one Thread Class? like create an object ThreadClass a= new ThreadClass; a.start(); a.start(); 2)How can u refresh a Servlet when new record is added to D.Base
threads & autorelease pool
threads & autorelease pool  How to set autorelease pool for NSThread method in Objective C?   [NSThread detachNewThreadSelector:@selector(yourMethod) toTarget:self withObject:nil]; - (void)yourMethod
multi threads - Java Beginners
using three threads. I want to declare variables which will be available to all the threads to access. Is there a way to declare the variables as global variables which will be available to all the threads. If so please send me the code
threads - Java Interview Questions
that will work even if many Threads are executing it simultaneously. Writing it is a black... interactions between Threads. You have to do it by logic. In a computer, something
interfaces,exceptions,threads
THE COMPLETE CONEPTS OF INTERFACES,EXCEPTIONS,THREADS   Interface...: Exception Handling in Java   Threads A thread is a lightweight process which exist within a program and executed to perform a special task. Several threads
Execution of Multiple Threads in Java
Execution of Multiple Threads in Java  Can anyone tell me how multiple threads get executed in java??I mean to say that after having called the start method,the run is also invoked, right??Now in my main method if I want
Threads - Java Interview Questions
. If you want to create threads, please visit the following link: http
Threads - Java Beginners
Threads  hi, how to execute threads prgm in java? is it using appletviewer as in applet?   Hi manju import java.awt.*; import...("/home/vinod/amarexamples:9090/" + "amarexamples/Threads/applet
regardoing multi threads - Java Beginners
regardoing multi threads  Hi Please tell me how to declare global variables in main thread so that all other threads can use them and value will be available to all threads. Thanks
Threads in Java Swing MVC Application
Threads in Java Swing MVC Application  Hello, I am currently making... threads into my program. I use the MVC paradigm and I just can't seem to implement custom threads into it, so my GUI doesn't freeze when I run certain parts
Threads on runnable interface - Java Beginners
Threads on runnable interface  need a program.....please reply asap Create 2 threads using runnable interface.First threads shd print "hello" & second shd print "welcome". using synchronisation tech print d words alternatively
Threads on runnable interface - Java Beginners
Threads on runnable interface  need a program.....please reply asap Create 2 threads using runnable interface.First threads shd print "hello" & second shd print "welcome". using synchronisation tech print d words alternatively
Java - Threads in Java
Java - Threads in Java       Thread is the feature of mostly languages including Java. Threads... be increased by using threads because the thread can stop or suspend a specific
java threads - Java Interview Questions
for Java threads in the range of 1 to 10. Following is the constaints defined
Running threads in servlet only once - JSP-Servlet
Running threads in servlet only once  Hi All, I am developing a project with multiple threads which will run to check database continuously. With those two separate threads I can check with database and do some other
How can combine threads and buttons?
How can combine threads and buttons?  I would like to start an application, stop it and restart it again and stop etc. I tried the following code. It does start and stop, but I get an error when I try to restart. Any
how to create a reminder app using threads in Servlets?
how to create a reminder app using threads in Servlets?  I want... (threads will be required!), a "pop-up window or a web-page should automatically get re-directed!". I have used threads for core java, but never used for Servlets
Threads in Java
Threads in Java help in multitasking. They can stop or suspend a specific... returns the number of active threads in a particular group and subgroups... the threads on which it is invoked.  yield( )  void
wap showing three threads working simulteniously upon single object.
wap showing three threads working simulteniously upon single object.  wap showing three threads working simulteniously upon single object
pls tell me the difference between the run() and start() in threads in java....
pls tell me the difference between the run() and start() in threads in java....  difference between the run() and start() in threads in java
Threads(suspend(),resume()) run time abnormal behaviour
Threads(suspend(),resume()) run time abnormal behaviour   class A implements Runnable { Thread t; A() { t=new Thread(this); t.start(); } public void run
implementing an algorithm using multi threads - Java Beginners
to breakdown into two or three threads and need to implemented and need
Diff between Runnable Interface and Thread class while using threads
Diff between Runnable Interface and Thread class while using threads  Diff between Runnable Interface and Thread class while using threads   Hi Friend, Difference: 1)If you want to extend the Thread class
Diff between Runnable Interface and Thread class while using threads
Diff between Runnable Interface and Thread class while using threads  Diff between Runnable Interface and Thread class while using threads   Hi Friend, Difference: 1)If you want to extend the Thread class
Advertisements
 

 

 

DMCA.com