From owner-freebsd-hackers Mon Sep 18 21:46:10 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from server.baldwin.cx (server.geekhouse.net [64.81.6.52]) by hub.freebsd.org (Postfix) with ESMTP id 0291337B422 for ; Mon, 18 Sep 2000 21:46:07 -0700 (PDT) Received: from john.baldwin.cx (root@john.baldwin.cx [192.168.1.18]) by server.baldwin.cx (8.9.3/8.9.3) with ESMTP id VAA69095; Mon, 18 Sep 2000 21:47:49 -0700 (PDT) (envelope-from john@baldwin.cx) Received: (from john@localhost) by john.baldwin.cx (8.9.3/8.9.3) id VAA05044; Mon, 18 Sep 2000 21:47:24 -0700 (PDT) (envelope-from john) Message-Id: <200009190447.VAA05044@john.baldwin.cx> X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20000919035519.24195.qmail@web115.yahoomail.com> Date: Mon, 18 Sep 2000 21:47:24 -0700 (PDT) From: John Baldwin To: Mohan Krishna P Subject: RE: semaphores inside kernel??? Cc: freebsd-hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 19-Sep-00 Mohan Krishna P wrote: > hi, > > i am implementing a pseudo-devicer, many instaces of > this device may be > active, all have to share a resource. all instances > have to synchronize > their access to the resource. trying to implement > this, i ended up with a > less powerful version of semaphores. since the > resultant code became > little complex, i want to replace that with the more > generic semaphores. > > i checked the include files, but i couldn't find any > semaphore > functions(semget,semctl,semop) which are specific or > meant for use inside > kernel. does it mean they aren't available inside > kernel?? if i am wrong, > can someone suggest me how to use them?? In the most recent -current kernels, there is a new recursive mutex that you can use. See the mutex(9) manpage for details.  > thank you, > mohan -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message