From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 25 18:54:20 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC7E31065673 for ; Mon, 25 Jul 2011 18:54:20 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by mx1.freebsd.org (Postfix) with ESMTP id 4A1C98FC23 for ; Mon, 25 Jul 2011 18:54:19 +0000 (UTC) Received: by fxe6 with SMTP id 6so7098394fxe.17 for ; Mon, 25 Jul 2011 11:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=nLiPIWkscpfKRnqBNxPLlxFxJCG7/c1Yc4F5fvTT/kc=; b=BeMjcGivNrl7ivKMx8mXvMPLxHQX8yuZiGhmGOQRKqh2pIVkqv13+L+v8bW6HLzdZa HcmjFF/gtxGFZNeKNiJJ8gGGS6nAy8+vWZfMQhG4bZZ0hfydtT/Xqy+YDOR9hHdF1ffB FeTqXsydE4PPA8lIrXt42FmUolojOMZKxewik= Received: by 10.223.61.133 with SMTP id t5mr350854fah.130.1311618441146; Mon, 25 Jul 2011 11:27:21 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id n18sm2913760fam.31.2011.07.25.11.27.19 (version=SSLv3 cipher=OTHER); Mon, 25 Jul 2011 11:27:20 -0700 (PDT) Sender: Alexander Motin Message-ID: <4E2DB579.7030804@FreeBSD.org> Date: Mon, 25 Jul 2011 21:27:05 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110709 Thunderbird/5.0 MIME-Version: 1.0 To: Filippo Sironi References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Kernel timers infrastructure X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:54:20 -0000 Hi. On 25.07.2011 17:13, Filippo Sironi wrote: > I'm working on a university project that's based on FreeBSD and I'm currently hacking the kernel... but I'm a complete newbie. > My question is: what if I have to call a certain function 10 times per second? > I've seen a bit of code regarding callout_* functions but I can't get through them. Is there anyone who can help me? Have you read callout(9) manual page? That API is right if you need to call some function. Also in some cases (if you need to make your kernel thread wait for something) you may use sleep(9) API. -- Alexander Motin