Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Feb 2007 19:39:25 -0800
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        lu ping <luping.nju@gmail.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: sleep in freebsd kernel
Message-ID:  <20070205033925.GA1620@funkthat.com>
In-Reply-To: <e80b0eb70702031328x43e742e8m90f9facfc1ec3ff1@mail.gmail.com>
References:  <e80b0eb70702031328x43e742e8m90f9facfc1ec3ff1@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
lu ping wrote this message on Sat, Feb 03, 2007 at 16:28 -0500:
> I have a question about making my kernel thread sleep for a while. I think I
> can use "tsleep", but the timeout for this call is only counted as system
> ticks (usually at millisecond granularity). However I want to make my
> "sleep" return in microsecond granularity. Does anybody know how to realize
> this?

Take a look at DELAY(9)...  This busy waits instead of sleeping...

FreeBSD currently doesn't have a method to make a kernel thread sleep
for sub-hz granularity...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070205033925.GA1620>