Re: a proposed callout API



On Tue, 28 Nov 2006 16:31:18 -0500
John Baldwin <jhb@xxxxxxxxxxx> wrote:

I had intended on using microseconds
with a negative value indicating a relative timeout (so an 'uptime'
timeout, i.e. trigger X us from now) and a positive value indicating an
absolute timeout (time_t-ish, and subject to ntp changes).

Just some devil's advocate thoughts...

What are the advantages of encoding some semantic in one or two bits of the
argument, instead of passing another word with flags? The obvious is more
one word on stack per call, but how many words will have the code to deal
with those encoded semantic bits? I can see 2 feasible cenarios:

1- the critical path deals with a single word, but can possibly have more
branches and/or operations due to additional manipulation needed (extract the
semantic bits and act on them)

2- two words must be popped, so there's the chance of a complete cache-miss
penalty, which turns out to be some hundred cycles in every architecture.

Also, limiting the resolution to microsecond may leave the kernel in a short
blanket situation, considering the future trends (we're almost in the
picosecond processor era, although even nanoseconds are used very much,
being microseconds the "right"[1] choice).

Comments?
:)

[1] as of 2006.

--
Ricardo Nabinger Sanchez <rnsanchez@{gmail.com,wait4.org}>
Powered by FreeBSD

"Left to themselves, things tend to go from bad to worse."
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: a proposed callout API
    ... with a negative value indicating a relative timeout (so an 'uptime' ... What are the advantages of encoding some semantic in one or two bits of the ... natural way to go in order to handle high precision events. ...
    (freebsd-arch)
  • Re: a proposed callout API
    ... with a negative value indicating a relative timeout (so an 'uptime' ... i.e. trigger X us from now) and a positive value indicating an ... The bits _will_ go in the flags argument I proposed. ...
    (freebsd-arch)
  • Re: Question about howto do proper timeout checking on connections
    ... > Setsockopt returns zero, indicating that the so_rcvtimeo was ... I used a timeout of 2500 ms to test this. ... Each time data is received or sent on a socket, ...
    (microsoft.public.win32.programmer.networks)
  • Re: setTimeout only delays first time in loop
    ... The key is going to be how you're calling that timeout. ... One runner runs to ... but they all trigger, in order, at 700ms intervals. ... Instead of a relay race this is a foot race with 20 people but each person ...
    (comp.lang.javascript)
  • Re: Timeout errors using Net::HTTP on Windows
    ... [maybe my boxes are too new so they don't trigger the problem?] ... The outermost timeout could timeout the inner one, ...
    (comp.lang.ruby)