From owner-freebsd-net Fri Oct 6 12:22:27 2000 Delivered-To: freebsd-net@freebsd.org Received: from hetnet.nl (net015s.hetnet.nl [194.151.104.155]) by hub.freebsd.org (Postfix) with ESMTP id 98AB737B503 for ; Fri, 6 Oct 2000 12:22:24 -0700 (PDT) Received: from hetnet.nl ([192.150.187.12]) by hetnet.nl with Microsoft SMTPSVC(5.5.1877.537.53); Fri, 6 Oct 2000 21:22:21 +0200 Message-ID: <39DE266B.E9975E2F@hetnet.nl> Date: Fri, 06 Oct 2000 12:22:19 -0700 From: Wilbert de Graaf Reply-To: wilbertdg@hetnet.nl X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: how to lock, but not using spl Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I have been working on some FreeBSD networking code, that used spl() to protect a linked list. I want to change this using ? so that it would run on SMP systems too. I monitored the SMP list and had a look in the 4.4BSD book but I haven't been able to find how to do it on BSD. Is there any sample or can anybopdy give me a pointer ? - Wilbert Some more info about what I would like to do: SLIST_HEAD slh; // gets called from the ioctl (the api) void my_ioctl(int n) { struct my_entry e = malloc(sizeof(struct my_entry), ...); e->id = n; // s = splnet(); ... ? ... SLIST_INSERT_HEAD(slh, e, e->link); // splx(s); ... ? ... } // gets called from a timer void my_timer(void) { struct my_entry e; FOREACH(e, slh) { if (e->done) { // s = splnet(); ... ? ... SLIST_REMOVE(slh, e, struct my_entry, e->link); // splx(s); ... ? ... } } } I have the impression simple_lock() can do this but I'm not sure if any of these processes can block on the other. Like what if the net timer mechanism has to block on a smiple api call. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message