This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Multiple jumps in one instruction




tm2@best.com said:

[SNIP]

> This scheme has huge problems.
> Consider this:
>
> static int a = 5;
> void func1(void)
> {
> 	return a *= 5;
> }
> void func2(void)
> {
> 	return a *= 3;
> }
> void main(void)
> {
> 	printf("%d\n", func1() + func2());
> }
>
> This program semi-randomly print either 90 or 100 depending on the
> timing between threads.

The same sort of problem that any multi-threaded program has. I know all
about the potential problems and ISO volations. The question still remains
can I do it. All I can say is for the processor in question it makes sense
to do this. The semi-random nature as you put it presumes the existence of
only one execution unit by the way.

JAB.

-- 
Jonathan A. Buzzard                 Email: jonathan@buzzard.org.uk
Northumberland, United Kingdom.       Tel: +44(0)1661-832195



-- 
Jonathan A. Buzzard                 Email: jonathan@buzzard.org.uk
Northumberland, United Kingdom.       Tel: +44(0)1661-832195



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]