Re: [LTP] [PATCH] mmstress: make shared global variables volatile

Wanlong Gao
2012-03-13T12:10:44Z

On 03/13/2012 06:32 PM, Jan Stancek wrote:

>
> Synchronization of threads depends on shared global variable.
> With gcc version 4.6.2 this test spins forever on:
> while (wait_thread)
> sched_yield();
>
> Make global shared variables volatile, so each thread
> sees current value.
>
> See also:
> Bug 36081 - gcc optimizations and threads (pthread)
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36081
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
> testcases/kernel/mem/mtest05/mmstress.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)

pushed, thanks Jan.

Wanlong Gao

>
>
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
>
>
>
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net