From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 26 04:39:21 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3ADE316A4CE for ; Thu, 26 Aug 2004 04:39:21 +0000 (GMT) Received: from hotmail.com (bay17-dav2.bay17.hotmail.com [64.4.43.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D11A43D46 for ; Thu, 26 Aug 2004 04:39:21 +0000 (GMT) (envelope-from yangshazhou@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 25 Aug 2004 20:56:54 -0700 Received: from 61.187.16.2 by bay17-dav2.bay17.hotmail.com with DAV; Thu, 26 Aug 2004 03:56:54 +0000 X-Originating-IP: [61.187.16.2] X-Originating-Email: [yangshazhou@hotmail.com] X-Sender: yangshazhou@hotmail.com From: To: Date: Thu, 26 Aug 2004 11:45:39 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: X-OriginalArrivalTime: 26 Aug 2004 03:56:54.0592 (UTC) FILETIME=[B9D11C00:01C48B20] X-Mailman-Approved-At: Thu, 26 Aug 2004 12:20:11 +0000 Subject: yield() in kernel CAN'T yield control for MOD_LOAD thread X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2004 04:39:21 -0000 >On Wednesday 25 August 2004 03:06 am, yangshazhou at hotmail.com wrote: >> Hi all, >> This problem delay me for quite a long time. >> I've built two klds, I'd like to see the result one's running to the >> other's. In one kld's MOD_LOAD subroutine, I make a long 'for' loop, in >> which it DELAY(1000) and then call yield(curthread,NULL). When the module >> was loaded by kldload, the system failed to response until the loop quit. >> The loop seems like that: >> for(i=0;i<8000;i++){ >> ...... >> DELAY(1000); >> yield(curthread,NULL); >> } >> > My system is 5.2.1-release. Thanks. > >You could try having the first one wait on a condition variable that the >second module's MOD_LOAD does a wakeup on.You mean, msleep(ident,...) in one module and wakeup(ident) in the other till the second module run out?But why yield() can't yield? It's because of the priority? I'll try msleep/wakeup anyway, thanks. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org