Java

Daemon Threads

Area: Java threads

A summary presentation about Daemon Threads

daemon_threads.pdf

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.

santa_multithreaded_program

santa_threads.zip

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

fibonacci_thread.zip

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_joke.zip

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.

server_client_url.zip

Scroll to Top