Re:Building a concurrent TCP server with libmill
by wcummings on Saturday July 25, 2015 @01:09PM
(#9948203)
Can anyone explain the deadlines vs timeout distinction?
[ Parent
| on HN ]
Re:Building a concurrent TCP server with libmill
by rumcajz on Saturday July 25, 2015 @01:15PM
(#9948218)
Timeout: finish in 10 seconds.
Deadline: finish at 7:15:35PM.
The advantage of deadlines is that you can define a fixed deadline and then re-use it for any number of calls, without having to subtract the time already spent in previous calls.
Re:Building a concurrent TCP server with libmill
by obstinate on Saturday July 25, 2015 @02:13PM
(#9948431)
Yes, and if you set the deadline on the client, the server knows (subject to its time skew) when the request needs to finish. With a timeout, you have to factor in latency, which is necessarily error prone.
Basically, deadline is a context-free timeout.
Re:Building a concurrent TCP server with libmill
by huhtenberg on Saturday July 25, 2015 @05:54PM
(#9949174)
... unless, of course, it's on the wall clock scale, in which case changing machine time will invalidate all your deadlines. Just need to be careful to use something like 'ticks from the last boot' rather than UTC time.