Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jul 2001 14:48:51 -0400
From:      "Louis-Philippe Gagnon" <louisphilippe@macadamian.com>
To:        "Julian Elischer" <julian@elischer.org>
Cc:        <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: flock/pthread bug?
Message-ID:  <1fbd01c10fba$499834d0$2964a8c0@macadamian.com>
References:  <Pine.BSF.4.21.0107181320030.94740-100000@InterJet.elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
From: "Julian Elischer" <julian@elischer.org>
> probably you should try :
>
>      #define   LOCK_NB        0x04      /* don't block when locking */
>
But I do want to block; I just don't want the whole process to block.

> Also if you have shared memory, why not use
>
> /* Get a spin lock, handle recursion inline (as the less common case) */

[snip inline asembly]

> the key is the cmpxchgl  instruction.
>
> use the cvsweb interface to explore these
> instructions. (also look at atomic.h I think)
>
Thanks, I'll try to decypher that. I'd rather have something portable though, and I would still like to know if what I was doing
should have worked...

Louis-Philippe Gagnon



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?1fbd01c10fba$499834d0$2964a8c0>