3 ms·
That built in lag is so incredibly miniscule in the grand scheme of programming that 99.9999% of times it will not matter, and if it does you are using C or Ass
by IpV8 10y ago
That built in lag is so incredibly miniscule in the grand scheme of programming that 99.9999% of times it will not matter, and if it does you are using C or Assembly anyways.
- yummyfajitas 10y agoNo, readLine will block until a line is available. Consider a command line IM app using pipes to communicate to the server (just to roll with the readLine example). User 1 has not typed anything, so their file is empty. User 2 has typed a bunch of stuff. user1line = readLine "user1file.pipe" user2line = readLine "user2file.pipe" getFirstAvailableFutureAndProcess [user1line, user2line] processorFunc What you want this to do is handle whichever user types something first. In reality it will only process user1line.
- teacup50 10y agoNo, it matters. Inefficiency adds up, and CPU cycles you waste on useless overhead aren't available to spend on something that actually matters -- like Garbage Collection.
- gpderetta 10y agoBoost.ASIO (and the corresponding C++ network TR proposal) uses HKTs to select the wait strategy (i.e. coroutines, futures, plain callbacks or whatever the user prefers) with minimal overhead.
- tunesmith 10y agoThat argument applies to the example of the abstraction, not the abstraction itself.
- colanderman 10y agoIt matters a lot if you are relying on asynchronous semantics. You risk deadlock if the request blocks.