Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Aug 2000 11:17:22 -0600
From:      Warner Losh <imp@village.org>
To:        Karl Pielorz <kpielorz@tdx.co.uk>
Cc:        Thomas Valentino Crimi <tcrimi+@andrew.cmu.edu>, hackers@FreeBSD.ORG
Subject:   Re: Critical (or equivalent) section in Userland? 
Message-ID:  <200008171717.LAA12865@harmony.village.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> <Utb0d7S00UwAMI3bU2@andrew.cmu.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200008171717.LAA12865>