- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are threading issues?
We can discuss some of the issues to consider in designing multithreaded programs. These issued are as follows −
The fork() and exec() system calls
The fork() is used to create a duplicate process. The meaning of the fork() and exec() system calls change in a multithreaded program.
If one thread in a program which calls fork(), does the new process duplicate all threads, or is the new process single-threaded? If we take, some UNIX systems have chosen to have two versions of fork(), one that duplicates all threads and another that duplicates only the thread that invoked the fork() system call.
If a thread calls the exec() system call, the program specified in the parameter to exec() will replace the entire process which includes all threads.
Generally, signal is used in UNIX systems to notify a process that a particular event has occurred. A signal received either synchronously or asynchronously, based on the source of and the reason for the event being signalled.
All signals, whether synchronous or asynchronous, follow the same pattern as given below −
A signal is generated by the occurrence of a particular event.
The signal is delivered to a process.
Once delivered, the signal must be handled.
Thread cancellation is the task of terminating a thread before it has completed.
For example − If multiple database threads are concurrently searching through a database and one thread returns the result the remaining threads might be cancelled.
A target thread is a thread that is to be cancelled, cancellation of target thread may occur in two different scenarios −
Asynchronous cancellation − One thread immediately terminates the target thread.
Deferred cancellation − The target thread periodically checks whether it should terminate, allowing it an opportunity to terminate itself in an ordinary fashion.
Multithreading in a web server, whenever the server receives a request it creates a separate thread to service the request.
Some of the problems that arise in creating a thread are as follows −
The amount of time required to create the thread prior to serving the request together with the fact that this thread will be discarded once it has completed its work.
If all concurrent requests are allowed to be serviced in a new thread, there is no bound on the number of threads concurrently active in the system.
Unlimited thread could exhaust system resources like CPU time or memory.
A thread pool is to create a number of threads at process start-up and place them into a pool, where they sit and wait for work.
- What are the issues in Merger & Acquisitions?
- What are the issues in database privacy?
- What are security issues in IP protocol?
- What are data link layer design issues?
- What are the Network Layer Design issues?
- What are the design issues of DES?
- What are the issues of Anomaly detection?
- What are the design Issues in the Physical Layer?
- What are the various issues related to data mining?
- What are the security issues in mobile database environment?
- What are the security issues in a data warehouse?
- Multi-Threading Models
- What are issues and solutions related to TCP in networks?
- What are issues in congestion and Flow control in LANs?
- What are the design issues in an Artificial Neural Network?