[riot-devel] bitfeilds

Juergen Stuber juergen at jstuber.net
Fri Oct 28 16:11:56 CEST 2016


On Fri, 28 Oct 2016 13:51:21 +0200
Ludwig Knüpfer <ludwig.knuepfer at fu-berlin.de> wrote:
> Am 28. Oktober 2016 10:03:17 MESZ, schrieb Juergen Stuber
> <juergen at jstuber.net>:
> >
> >IMHO it is also better to use shift and mask because a write to a
> >bitfield is actually a hidden non-atomic read-update-write, which
> >may become dangerous when you have concurrent access.
> 
> Maybe I misunderstood you, but I would be very surprised if shift and
> mask is atomic.

Most of the time it's not atomic, but the read-update-write will be
more explicit.

Grüße
Jürgen

-- 
Jürgen Stuber <juergen at jstuber.net>
http://www.jstuber.net/
1B78 A579 E159 2A85 67BB  1314 C083 224B 0F9C DA21
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.riot-os.org/pipermail/devel/attachments/20161028/c69f740b/attachment.sig>


More information about the devel mailing list