gnu.gcc.help
[Top] [All Lists]

Re: How could pthread_mutex_lock/unlock affect compiler optimization an

Subject: Re: How could pthread_mutex_lock/unlock affect compiler optimization and / or caching??
From: mynickmynick <mynickmynick@xxxxxxxxx>
Date: Thu, 17 Jul 2008 09:20:33 -0700 (PDT)
Newsgroups: gnu.gcc.help

On Jul 17, 4:15 pm, Paul Pluzhnikov <ppluzhnikov-...@xxxxxxxxx> wrote:
> mynickmynick <mynickmyn...@xxxxxxxxx> writes:
> > How could pthread_mutex_lock / unlock affect compiler optimization
> > and / or caching??
>
> Homework?
>
> A: In many ways. Think about it: can a variable be kept in a register
> across a call to pthread_mutex_lock() ?
>
> Cheers,
> --
> In order to understand recursion you must first understand recursion.
> Remove /-nsp/ for email.

that was exactly what I was thinking about
if a variable is inside lock/unlock then it cannot be taken from a
previous cache and/or register
but are compiler so "smart"
that is : is pthread_mutex_lock part of C language or not (function
like any other?) ??
It seems to me there is quite confusion around this topic

Please refer also to this discussion
http://cboard.cprogramming.com/showthread.php?t=105260
and to this
http://cboard.cprogramming.com/showthread.php?t=105235



<Prev in Thread] Current Thread [Next in Thread>