Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

disadvantage of threads

Ads

 
 

Share on Google+Share on Google+

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

hello,

Can somebody tell me What is the disadvantage of threads?

Ads
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


Ads









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
Version of cornerstone-threads>cornerstone-threads-api dependency
List of Version of cornerstone-threads>cornerstone-threads-api dependency
Version of cornerstone-threads>cornerstone-threads-impl dependency
List of Version of cornerstone-threads>cornerstone-threads-impl dependency
Version of cornerstone-threads>cornerstone-threads-tutorial dependency
List of Version of cornerstone-threads>cornerstone-threads-tutorial dependency
Threads in realtime projects
Threads in realtime projects  Explain where we use threads in realtime projects with example
Coding for life cycle in threads
Coding for life cycle in threads  program for life cycle in threads
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
Version of cornerstone-threads-api>cornerstone-threads-api dependency
List of Version of cornerstone-threads-api>cornerstone-threads-api dependency
Version of cornerstone-threads-tutorial>cornerstone-threads-tutorial dependency
List of Version of cornerstone-threads-tutorial>cornerstone-threads-tutorial dependency
Version of cornerstone-threads-impl>cornerstone-threads-impl dependency
List of Version of cornerstone-threads-impl>cornerstone-threads-impl dependency
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
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
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
Artifacts of cornerstone-threads
List of Artifacts of cornerstone-threads maven depenency
Artifacts of cornerstone-threads-api
List of Artifacts of cornerstone-threads-api maven depenency
Artifacts of cornerstone-threads-impl
List of Artifacts of cornerstone-threads-impl maven depenency
Artifacts of cornerstone-threads-tutorial
List of Artifacts of cornerstone-threads-tutorial maven depenency