Tutorialspoint

1 Answer
Kristi Castro
, 16 Views

Multithreaded programs allow the execution of multiple parts of a program at the same time. These parts are known as threads and are lightweight processes available within the process.

Threads improve the application performance using parallelism. They share information like data segment, code segment files etc. with their peer threads while they contain their own registers, stack, counter etc.

Some of the issues with multithreaded programs are as follows:

Multithreading

Let us see them one by one:

  1. Increased Complexity: Multithreaded processes are quite complicated. Coding for these can only be handled by expert programmers.

  2. Complications due to Concurrency: It is difficult to handle concurrency in multithreaded processes. This may lead to complications and future problems.

  3. Difficult to Identify Errors: Identification and correction of errors is much more difficult in multithreaded processes as compared to single threaded processes.

  4. Testing Complications: Testing is a complicated process i multithreaded programs as compared to single threaded programs. This is because defects can be timing related and not easy to identify.

  5. Unpredictable results: Multithreaded programs can sometimes lead to unpredictable results as they are essentially multiple parts of a program that are running at the same time.

  6. Complications for Porting Existing Code: A lot of testing is required for porting existing code in multithreading. Static variables need to be removed and any code or function calls that are not thread safe need to be replaced.

Advertisements