vsalaksh
BAN USERSolution using classes from ConcurrentPackage:
Algorithm:
1. Create a Semaphore and initialize with N -the number of tasks.
2. Create a task X which needs Y permits to execute. ( values of Y -> 1 to N)
3. The value of Y to assign for a task depends on after how many tasks it should start execute.
3. once the task X completes, it release the Y permits.
4. For example, the task which needs to be executed at first assigned value 1 to Y, similarly the second task assigned with value 2 for Y, like that the last task assigned N value for Y
5. Start all the tasks.
This Semaphore will ensure all the tasks run sequentially
Ok, in that case we need to have two queues of 16 bytes size, the input device first put the data in to the q1, once its full, it will move that in to disk writer and trigger disk writer (using countdown latch). And input device start putting the data in to q2. Once q2 become full(which will happen after 4 seconds), it will swap the queue to disk writer, then start writing in to the swapped queue
- vsalaksh July 13, 2015
RepSince 1991, Lakeview Blinds Awnings & Shutters offers stunning interior and exterior blinds, shutters, awnings and security doors & windows to the ...
- vsalaksh September 04, 2015