Hi!
On Mon, Jul 23, 2018 at 12:36:50PM +0200, David Brown wrote:
> This is nothing to do with undefined behaviour, but a matter of
> scheduling of effects that are visible in different circumstances. In
> particular, i and j are declared in a way that tells the compiler that
> the compiler, in it
Hi,
This is nothing to do with undefined behaviour, but a matter of
scheduling of effects that are visible in different circumstances. In
particular, i and j are declared in a way that tells the compiler that
the compiler, in its current thread of execution has full control of
them. The compiler
On Sonntag, 22. Juli 2018 17:01:29 CEST Umesh Kalappa wrote:
> Allan ,
>
> >>he might as well go traditional
>
> you mean using the locks ?
>
No I am meant relying on undefined behavior. In your case I would recommend
using modern atomics, which is defined behavior, and modern and fast. I was
Allan ,
>>he might as well go traditional
you mean using the locks ?
Thank you
~Umesh
On Sat, Jul 21, 2018 at 4:20 AM, Allan Sandfeld Jensen
wrote:
> On Samstag, 21. Juli 2018 00:21:48 CEST Jonathan Wakely wrote:
>> On Fri, 20 Jul 2018 at 23:06, Allan Sandfeld Jensen wrote:
>> > On Freitag, 20.
Hi Richard,
making i unsigned still the optimization is effective ,no luck.
and yes test() is the threaded routine and since i and j are global
,we need the side effects take place like assignment etc ,that are
observed by other threads .
By making volatile or thread safe or atomic operations
On Samstag, 21. Juli 2018 00:21:48 CEST Jonathan Wakely wrote:
> On Fri, 20 Jul 2018 at 23:06, Allan Sandfeld Jensen wrote:
> > On Freitag, 20. Juli 2018 14:19:12 CEST Umesh Kalappa wrote:
> > > Hi All ,
> > >
> > > We are looking at the C sample i.e
> > >
> > > extern int i,j;
> > >
> > > int t
On Fri, 20 Jul 2018 at 23:06, Allan Sandfeld Jensen wrote:
>
> On Freitag, 20. Juli 2018 14:19:12 CEST Umesh Kalappa wrote:
> > Hi All ,
> >
> > We are looking at the C sample i.e
> >
> > extern int i,j;
> >
> > int test()
> > {
> > while(1)
> > { i++;
> > j=20;
> > }
> > return 0;
>
On Freitag, 20. Juli 2018 14:19:12 CEST Umesh Kalappa wrote:
> Hi All ,
>
> We are looking at the C sample i.e
>
> extern int i,j;
>
> int test()
> {
> while(1)
> { i++;
> j=20;
> }
> return 0;
> }
>
> command used :(gcc 8.1.0)
> gcc -S test.c -O2
>
> the generated asm for x86
>
On 07/20/2018 12:17 PM, Richard Biener wrote:
On July 20, 2018 7:59:10 PM GMT+02:00, Martin Sebor wrote:
On 07/20/2018 06:19 AM, Umesh Kalappa wrote:
Hi All ,
We are looking at the C sample i.e
extern int i,j;
int test()
{
while(1)
{ i++;
j=20;
}
return 0;
}
command used :(gc
On July 20, 2018 7:59:10 PM GMT+02:00, Martin Sebor wrote:
>On 07/20/2018 06:19 AM, Umesh Kalappa wrote:
>> Hi All ,
>>
>> We are looking at the C sample i.e
>>
>> extern int i,j;
>>
>> int test()
>> {
>> while(1)
>> { i++;
>> j=20;
>> }
>> return 0;
>> }
>>
>> command used :(gcc 8.1
On 07/20/2018 06:19 AM, Umesh Kalappa wrote:
Hi All ,
We are looking at the C sample i.e
extern int i,j;
int test()
{
while(1)
{ i++;
j=20;
}
return 0;
}
command used :(gcc 8.1.0)
gcc -S test.c -O2
the generated asm for x86
.L2:
jmp .L2
we understand that,the infi
On Fri, Jul 20, 2018 at 05:49:12PM +0530, Umesh Kalappa wrote:
> We are looking at the C sample i.e
>
> extern int i,j;
>
> int test()
> {
> while(1)
> { i++;
> j=20;
> }
> return 0;
> }
>
> command used :(gcc 8.1.0)
> gcc -S test.c -O2
>
> the generated asm for x86
>
> .L2:
>
Hi All ,
We are looking at the C sample i.e
extern int i,j;
int test()
{
while(1)
{ i++;
j=20;
}
return 0;
}
command used :(gcc 8.1.0)
gcc -S test.c -O2
the generated asm for x86
.L2:
jmp .L2
we understand that,the infinite loop is not deterministic ,compiler
is fr
13 matches
Mail list logo