The search-insert-delete problem: Three kinds of threads share access to a singl
ID: 3553312 • Letter: T
Question
The search-insert-delete problem:
Three kinds of threads share access to a singly-linked list: searchers, inserters and deleters work according to the following rules:
- Searchers merely examine the list; hence they can execute concurrently with each other.
- Inserters add new items to the end of the list; insertions must be mutually ex-clusive to preclude two inserters from inserting new items at about the same time. However, one insert can proceed in parallel with any number of searches.
-Deleters remove items from any-where in the list. At most one deleter process can access the list at a time, and deletion must also be mutually exclusive with searches and insertions.
Write java program using semaphores for searchers, inserters and deleters that enforces this kind of three-way categorical mutual exclusion. Write a driver to demo the program. Make the program reads the input from a data file that includes data items to inserted, data items to be deleted, commands (I, D, S), and number of threads of each kind i.e. insetres, deleters, and searchers.
FIRST ANSWER WILL GET THE POINTS DIRECTLY !!