top | item 5075102

(no title)

0xABADC0DA | 13 years ago

The timer still exists and leaks memory until the timeout expires. For instance if you write an interactive command-line tool reading one character at a time from stdin with a 5 minute timeout it works fine when used interactively, but if you cat a file to it then it explodes memory (because a timer exists for 5 minutes for every byte read).

This is a language designed for concurrency where there's no way to have an efficient timeout for blocking operations. Blocking operations and timeouts go hand-in-hand (select(), poll(), pthread_cond_timedwait(), etc) so why doesn't "select{}" have a timeout clause? It makes no sense. Not even to mention what happens when the system time changes by a lot (your app probably gets hosed).

discuss

order

No comments yet.