Re: [Mesa-dev] [PATCH 7/7] c11: Make TIME_UTC a conditional macro.

2014-01-23 Thread Jose Fonseca
- Original Message -
> On Thu, Jan 09, 2014 at 11:32:10AM -0800, Jose Fonseca wrote:
> > This series is pretty much what I proposed several months ago, rebased on
> > top of master, with minor if any tweaks.
> > 
> > Still to do is remove the deprecated abstractions (which now are mere
> > wrappers of the c11 ones).
> > 
> > That said, this series is already useful as is, not only because of
> > the code de-duplication, but also because the Windows conditional var
> > implemention in master is poll-based so performs quite badly, in
> > particular llvmpipe with many threads.  Which is fixed here.
> > 
> > IMHO the rest can be done as time permits...
> > 
> > Jose
> 
> This series looks good to me. But I'd like to see patch 7 squashed into
> patch 2 to prevent possible build failures during bisects.

Thanks for all the reviews.

I've addressed all issues that were raised during review, and I'm finally about 
to push this series.

> I like how this series opens up opportunities for additional cleanups.
> In particular, we can now begin to remove the threading wrappers in
> src/egl/main.
> 

Yes, I didn't had the time to go that far, but that is indeed the hope.


One remark, the bundled C11/threads.h headers provide a non-standard static 
mutex static initializer:

  // FIXME: temporary non-standard hack to ease transition
  #define _MTX_INITIALIZER_NP PTHREAD_MUTEX_INITIALIZER

because unfortunately C11's  does not provide static mutex 
initializers.  Instead it provides "one time initialization" objects, which as 
a bit harder to use, but do pretty much the same thing.

This non-standard initializer is just a temporary hack -- I'm not advocating we 
keep this forever.  Rather, I think that when we do purge Mesa source from all 
threading wrappers, we should try as much as possible avoid these static 
mutexes, so that one day we can use system provided C11/threads.h if they ever 
become available.


Jose
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 7/7] c11: Make TIME_UTC a conditional macro.

2014-01-10 Thread Chad Versace
On Thu, Jan 09, 2014 at 11:32:10AM -0800, Jose Fonseca wrote:
> This series is pretty much what I proposed several months ago, rebased on top 
> of master, with minor if any tweaks.
> 
> Still to do is remove the deprecated abstractions (which now are mere
> wrappers of the c11 ones).
> 
> That said, this series is already useful as is, not only because of
> the code de-duplication, but also because the Windows conditional var
> implemention in master is poll-based so performs quite badly, in
> particular llvmpipe with many threads.  Which is fixed here.
> 
> IMHO the rest can be done as time permits...
> 
> Jose

This series looks good to me. But I'd like to see patch 7 squashed into
patch 2 to prevent possible build failures during bisects.

I like how this series opens up opportunities for additional cleanups.
In particular, we can now begin to remove the threading wrappers in
src/egl/main.

I'm not familiar with C11's thread headers, so patch 2 is
Acked-by: Chad Versace 

Patches 3-7 are:
Reviewed-by: Chad Versace 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 7/7] c11: Make TIME_UTC a conditional macro.

2014-01-09 Thread Ian Romanick
This should get squashed with patch #2 when you push this.  That will
prevent possible build breaks while bisecting.

On 01/09/2014 11:20 AM, jfons...@vmware.com wrote:
> From: José Fonseca 
> 
> Some system headers already define it, so this prevents conflict.
> ---
>  include/c11/threads.h | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/include/c11/threads.h b/include/c11/threads.h
> index 678774c..4a4079d 100644
> --- a/include/c11/threads.h
> +++ b/include/c11/threads.h
> @@ -10,6 +10,10 @@
>  
>  #include 
>  
> +#ifndef TIME_UTC
> +#define TIME_UTC 1
> +#endif
> +
>  #include "c99_compat.h" /* for `inline` */
>  
>  /* types */
> @@ -39,8 +43,6 @@ enum {
>  thrd_nomem// out of memory
>  };
>  
> -enum { TIME_UTC = 1 };
> -
>  /*-- functions --*/
>  
>  #if defined(_WIN32) && !defined(__CYGWIN__)
> 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 7/7] c11: Make TIME_UTC a conditional macro.

2014-01-09 Thread Brian Paul

LGTM.  Reviewed-by: Brian Paul 

On 01/09/2014 12:32 PM, Jose Fonseca wrote:

This series is pretty much what I proposed several months ago, rebased on top 
of master, with minor if any tweaks.

Still to do is remove the deprecated abstractions (which now are mere wrappers 
of the c11 ones).

That said, this series is already useful as is, not only because of the code 
de-duplication, but also because the Windows conditional var implemention in 
master is poll-based so performs quite badly, in particular llvmpipe with many 
threads.  Which is fixed here.

IMHO the rest can be done as time permits...

Jose

- Original Message -

From: José Fonseca 

Some system headers already define it, so this prevents conflict.
---
  include/c11/threads.h | 6 --
  1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/c11/threads.h b/include/c11/threads.h
index 678774c..4a4079d 100644
--- a/include/c11/threads.h
+++ b/include/c11/threads.h
@@ -10,6 +10,10 @@

  #include 

+#ifndef TIME_UTC
+#define TIME_UTC 1
+#endif
+
  #include "c99_compat.h" /* for `inline` */

  /* types */
@@ -39,8 +43,6 @@ enum {
  thrd_nomem// out of memory
  };

-enum { TIME_UTC = 1 };
-
  /*-- functions --*/

  #if defined(_WIN32) && !defined(__CYGWIN__)
--
1.8.3.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 7/7] c11: Make TIME_UTC a conditional macro.

2014-01-09 Thread Jose Fonseca
This series is pretty much what I proposed several months ago, rebased on top 
of master, with minor if any tweaks.

Still to do is remove the deprecated abstractions (which now are mere wrappers 
of the c11 ones).

That said, this series is already useful as is, not only because of the code 
de-duplication, but also because the Windows conditional var implemention in 
master is poll-based so performs quite badly, in particular llvmpipe with many 
threads.  Which is fixed here.

IMHO the rest can be done as time permits...

Jose

- Original Message -
> From: José Fonseca 
> 
> Some system headers already define it, so this prevents conflict.
> ---
>  include/c11/threads.h | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/include/c11/threads.h b/include/c11/threads.h
> index 678774c..4a4079d 100644
> --- a/include/c11/threads.h
> +++ b/include/c11/threads.h
> @@ -10,6 +10,10 @@
>  
>  #include 
>  
> +#ifndef TIME_UTC
> +#define TIME_UTC 1
> +#endif
> +
>  #include "c99_compat.h" /* for `inline` */
>  
>  /* types */
> @@ -39,8 +43,6 @@ enum {
>  thrd_nomem// out of memory
>  };
>  
> -enum { TIME_UTC = 1 };
> -
>  /*-- functions --*/
>  
>  #if defined(_WIN32) && !defined(__CYGWIN__)
> --
> 1.8.3.2
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev