From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 14 Apr 2022 16:19:41 +0200 (CEST) From: Richard Weinberger Message-ID: <1113877096.254279.1649945981167.JavaMail.zimbra@nod.at> In-Reply-To: References: <20220413215819.22954-1-richard@nod.at> <7d2e38dc-7386-e703-2e09-572874c5e162@siemens.com> <2065449276.254073.1649941119506.JavaMail.zimbra@nod.at> Subject: Re: [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Florian Bezdeka Cc: Jan Kiszka , xenomai ----- Urspr=C3=BCngliche Mail ----- > Von: "Florian Bezdeka" >> ...same does marking both variables as volatile. >=20 > I don't have much context here, but volatile sounds like a valid > solution (assuming that safety is written by a different thread) Both variables are written by the very same thread. The problem is that the don't get used later, so the compiler is free to remove the loop. That's why the barrier fixes the problem. It forces the compiler to keep the loop. Thanks, //richard