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: Paul Pluzhnikov <ppluzhnikov-nsp@xxxxxxxxx>
Date: Thu, 17 Jul 2008 22:01:18 -0700
Newsgroups: gnu.gcc.help

mynickmynick <mynickmynick@xxxxxxxxx> writes:

> 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?) ??

I don't get you. Several people have already answered your questions,
but you keep asking the same questions over and over :(

For most compilers, pthread_mutex_lock is a function *just* like
any other. A compiler can not keep a global variable in a register
across a call to *any* function, for which it has not seen the
source, and pthread_mutex_lock is one such function.

> It seems to me there is quite confusion around this topic

Yes, you appear to be confused, despite everybody's best effors :(

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.

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