multi-threaded environment questions. willing to know new things as I am going to wrk
Problem Statement:
Design and Implement a Task Execution System which accepts the tasks from a client application and execute the task. The details are given below
Client:
Client will create the following types of Task
1. Task 1 (Priority 1):
Generate a random number > 10000000000 and print the following information
Priority
The Random Number generated
Time-Stamps: Task Entry (Added to queue), Task Start Time, Task Completed.
Waiting Time in milliseconds
2. Task 2 (Priority 2):
Calculate a random Prime Number which is >100 and print the following information
Priority
Prime Number
Time-Stamps: Task Entry (Added to queue), Task Start Time, Task Completed.
Waiting Time in milliseconds
3. Task 3 (Priority 3):
Generate a random Fibonacci Number >100 and print the following information,
Priority
Fibonacci Number
Time-Stamps: Task Entry (Added to queue), Task Start Time, Task Completed.
Waiting Time in milliseconds
These tasks must be generated at the given rate (Task/Minute), this rate must be configurable.
The task creation must be evenly spread across 1 minute.
Once the task is created, it must be sent to the server over an http channel.
Server:
The server must accept the tasks, and execute them based on the following criteria:
1. Higher priority task are to be executed first.
2. When a task is in the queue for more than 3 seconds, the priority must be increased by 1 unit.
Note:
• Priorities: 1 – High, 2-Medium, 3 - Low
• Where ever possible use COM libraries.
• The client and server application can be hosted on same machine or on different machines.
• Every task must take 1 sec to complete .i.e. (The moment the Task was taken for execution and the moment the task execution is completed, must be and 1 sec interval).
|