Generic Multi Threaded Linked list for java with thread safety.
It is a simple implementation of Linked list to deal with multiple threads accessing the linked list.
MAdd, MUpdate, MDelete are the classes implementing Runnable interface to add, update, and delete in a safe manner for a multithreaded scenario. MLinkedList is the class which actually implements the linked list. MultiThreadedLinkedList is the main method which just shows an example of how to use the linked list.
Instructions to run the test code:
- Extract the files in a folder.
- Run the command from terminal javac *.java
- Go to the parent folder and run it from there using the command.
java multithreadedlinkedlist.MultiThreadedLinkedList where multithreadedlinkedlist is the name of your package folder.
To Use it in one of yor programs, just copy every class except multithreadedlinkedlist. For using it, you can check out the code in multithreadedlinkedlist's main method.