A computer program product for managing a plurality of counters in a digital versatile disc system, having a system clock, a multi-threaded operating system having a semaphore with a semaphore queue and a playback program with a system program thread, the computer program product comprising a computer usable medium having computer readable program code thereon comprising:
- program code for using the system program thread in cooperation with the operating system to create a single independent counter program thread in the playback program when at least one of the plurality of counters is to be utilized by the system, the counter thread exclusively controlling counters that are placed under its control and becoming dormant when created;
- program code for sending commands from the system program thread to the counter program thread specifying each of the plurality of counters and causing the each counter to be placed under control of the counter program thread;
- program code for inserting a message into the semaphore queue at predetermined intervals of time as determined by the system clock, whereupon the semaphore detects a message in the semaphore queue and wakes up the counter program thread;
- program code for using the counter program thread, when awakened, to increment and decrement all counters under its control independently of the system program thread, the counter program thread then becoming dormant;
- and
- program code for controlling the counter program thread at times when the counter program thread is not incrementing and decrementing counters under its control to execute another function on the counters under its control.