Hacker News new | past | comments | ask | show | jobs | submit login

The low level APIs do not require any knowledge of the OS scheduling. The code is not complex in the way you think it is - there is little algorithmic behaviour in a CD Burning task.



Let's see: predictive I/O scheduling, buffer management, and cryptographic checksums all seem like they fall within the realm of "algorithms," and all would be fairly necessary to a well-behaved non-trivial CD-burning system. And yes, you would need to have some idea how the operating system schedules tasks if you are to have any luck maintaining write throughput to keep from under-buffering.


That would be over-engineering. You want to keep your buffer full:

if buffer not full:

wait (time for 5 writes);

write to 5 * read_size to buffer;

Sure, you could do it more complex, but then you create fragile code at a spot when a simppler solution would work fine.


But even the fact that you have to decide on the buffer size is a matter of understanding the theory. Choosing to multiply by 5 too. Why is it 5 and 12? Why the buffer size is not the half or double the size that it has? How can you prove that you have chosen the correct values if not by theory?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: