All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: How to make a kernel thread sleep for a short amount of time?
Date: Thu, 04 Jul 2002 14:22:29 -0700	[thread overview]
Message-ID: <3D24BC95.3030006@candelatech.com> (raw)

I am re-working the net/core/pktgen code to be a kernel thread.

It is basically working, but I am having trouble making the thread
efficiently sleep for durations in the milisecond and micro-second range.

I have looked at the udelay and mdelay methods, but they busy
wait.

I do not need absolute real-time precision, so if I ask the thread
to sleep for 100 micro-seconds, it is not a big deal if it does
not wake up for 5000us.  On average, it should be very close to 100us.

I believe the answer may be to use some sort of timer and have my
thread sleep on this timer, but I cannot find any examples or
documentation on how to do this on the web.

If anyone can point me to some example code or documentation, I
would appreciate it.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear



             reply	other threads:[~2002-07-04 21:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-04 21:22 Ben Greear [this message]
2002-07-04 21:36 ` How to make a kernel thread sleep for a short amount of time? bert hubert
2002-07-18 14:39 ` Corey Minyard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D24BC95.3030006@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.