Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The low level API calls that you make, make use of the OS scheduling. But you may claim that you can be agnostic to this fact. On the other hand optimizing your code to run efficiently can be done either using your gut feeling, or by understanding the complexity of your code, to make it run faster, with fewer calls, and optimal buffer usage. Would that suffice as an answer to your question?


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?


Exactly. Check out the Linux O(1) time scheduler.

http://www.ibm.com/developerworks/linux/library/l-scheduler/




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

Search: