Daemon Threads
Thread programming Example 1: (Santa and the North Pole)
Area: Java threads
Written in Java
(Documentation and source code attached)
Multi-threaded program program that implements the work life at the North Pole.
When Santa checks the workList, and there is no work, he waits (blocks) until some work is created and added to the workList. To wake Santa up, the UI thread needs to do a notify each time work gets added to the workList.
Thread programming Example 2: (Web page characters count)
Area: Java threads
Written in Java
(Documentation and source code attached)
- A worker thread fills an array passed by the manager with the first 1000 Fibonacci number
- A main class launches the worker thread
Server-Client Example 1: (Joke Server)
Area: Java sockets
Written in Java
(Documentation and source code attached)
- Client
- Make a connection to server socket
- Read the Joke from the socket
- Close the socket connection
- Server
- Listen for connections
- Generate random joke
- Write joke to socket
- Close socket
Server-Client Example 2: (Web page characters count)
Area: Java sockets and threads
Written in Java
(Documentation and source code attached)
- Client
- Make a connection to the server socket
- Send a set of collected URLs to the server
- Server
- A worker thread connects to each URL and counts the number of characters from that URL.