From owner-freebsd-hackers Thu Aug 17 10:18:20 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 5072E37B7DB for ; Thu, 17 Aug 2000 10:18:16 -0700 (PDT) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id LAA36102; Thu, 17 Aug 2000 11:18:12 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id LAA12865; Thu, 17 Aug 2000 11:17:22 -0600 (MDT) Message-Id: <200008171717.LAA12865@harmony.village.org> To: Karl Pielorz Subject: Re: Critical (or equivalent) section in Userland? Cc: Thomas Valentino Crimi , hackers@FreeBSD.ORG In-reply-to: Your message of "Thu, 17 Aug 2000 17:16:49 BST." <399C0FF1.2F97B106@tdx.co.uk> References: <399C0FF1.2F97B106@tdx.co.uk> <399BA212.A84240AE@tdx.co.uk> Date: Thu, 17 Aug 2000 11:17:22 -0600 From: Warner Losh Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <399C0FF1.2F97B106@tdx.co.uk> Karl Pielorz writes: : Thomas Valentino Crimi wrote: : : > Take a look at rtprio(2), giving yourself a realtime priority will : > guarantee you the CPU until you explicitly release it (or another higher : > priority realtime process comes along). I'm not sure if the same : > deadlock potential that exists with giving a process an idle priority : > exists due to locking in the kernel, although I see no mention of it in : > the man pages. It's definitely something I'd be wary of, though. : : Thanks, I'll look at that... Presumably, even though my process is making : syscalls, when they're completed - the scheduler _should_ look to run me : first, due to the very high priority? Yes, but in the interrum others can schedule time. : If this doesn't work - I think I'm going to have to look to fixing the problem : (and removing the need to 'put the world on hold' while the program tinkers : with a few files)... You are better off doing an atomic operation. trust me. Alternatively, you should use advisory locks for anybody that is cooperating with you. You didn't indicate that this had to run in a hostile environment. Much easier to do, much more robust than messing with rtprio and likely what you really want anyway. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message