Re: [Patch, libfortran] Multi-threaded random_number

2016-08-12 Thread Janne Blomqvist
On Fri, Aug 12, 2016 at 1:07 PM, Thomas Schwinge wrote: > Hi! > > On Thu, 11 Aug 2016 12:01:59 +0300, Janne Blomqvist > wrote: >> committed a slightly modified patch as r239356. [...] > > This breaks the build for nvptx Sorry about that! > (but it may actually be a problem > specific to the nv

Re: [Patch, libfortran] Multi-threaded random_number

2016-08-12 Thread Thomas Schwinge
Hi! On Thu, 11 Aug 2016 12:01:59 +0300, Janne Blomqvist wrote: > committed a slightly modified patch as r239356. [...] This breaks the build for nvptx (but it may actually be a problem specific to the nvptx-newlib); I filed "libgfortran: build breaks if localtime_r

Re: [Patch, libfortran] Multi-threaded random_number

2016-08-11 Thread Janne Blomqvist
On Thu, Aug 11, 2016 at 5:54 PM, Rainer Orth wrote: > Hi Janne, > >> committed a slightly modified patch as r239356. Changes from the >> submitted patch attached. To my surprise, it turned out that my >> fallback code using __gthread_key_{create,delete} and >> __ghtread_{get,set}_specific was fast

Re: [Patch, libfortran] Multi-threaded random_number

2016-08-11 Thread Rainer Orth
Hi Janne, > committed a slightly modified patch as r239356. Changes from the > submitted patch attached. To my surprise, it turned out that my > fallback code using __gthread_key_{create,delete} and > __ghtread_{get,set}_specific was faster than my TLS code, so I removed > the TLS configure magic

Re: [Patch, libfortran] Multi-threaded random_number

2016-08-11 Thread Janne Blomqvist
Hi, committed a slightly modified patch as r239356. Changes from the submitted patch attached. To my surprise, it turned out that my fallback code using __gthread_key_{create,delete} and __ghtread_{get,set}_specific was faster than my TLS code, so I removed the TLS configure magic and the TLS code

Re: [Patch, libfortran] Multi-threaded random_number

2016-08-10 Thread Janne Blomqvist
Hi, thanks for the Ok. However, moments before committing I got cold feet and started digging around; it unfortunately seems that TLS (_Thread_local) is not supported on all targets. So I'll have to copy-paste some configure magic from libgomp/libjava/etc., and provide workarounds for such systems

Re: [Patch, libfortran] Multi-threaded random_number

2016-08-08 Thread Jerry DeLisle
On 08/08/2016 04:01 AM, Janne Blomqvist wrote: PING**2 OK, thanks for patch. Jerry On Sun, Jul 24, 2016 at 4:45 PM, Janne Blomqvist wrote: Hi, the attached patch replaces the current random_number / random_seed implementations with an implementation that better supports threads. It's an i

Re: [Patch, libfortran] Multi-threaded random_number

2016-08-08 Thread Janne Blomqvist
PING**2 On Sun, Jul 24, 2016 at 4:45 PM, Janne Blomqvist wrote: > Hi, > > the attached patch replaces the current random_number / random_seed > implementations with an implementation that better supports threads. > It's an improved version of the RFC patch I posted earlier at > https://gcc.gnu.or

Re: [Patch, libfortran] Multi-threaded random_number

2016-08-01 Thread Janne Blomqvist
On Mon, Aug 1, 2016 at 1:48 PM, Andreas Schwab wrote: > On Mo, Aug 01 2016, Janne Blomqvist wrote: > >> PING? >> >> Also, a minor bugfix on top of the previous patch: >> >> diff --git a/libgfortran/intrinsics/random.c >> b/libgfortran/intrinsics/random.c >> index 9b54a02..21395ea 100644 >> --- a

Re: [Patch, libfortran] Multi-threaded random_number

2016-08-01 Thread Andreas Schwab
On Mo, Aug 01 2016, Janne Blomqvist wrote: > PING? > > Also, a minor bugfix on top of the previous patch: > > diff --git a/libgfortran/intrinsics/random.c b/libgfortran/intrinsics/random.c > index 9b54a02..21395ea 100644 > --- a/libgfortran/intrinsics/random.c > +++ b/libgfortran/intrinsics/rando

Re: [Patch, libfortran] Multi-threaded random_number

2016-08-01 Thread Janne Blomqvist
PING? Also, a minor bugfix on top of the previous patch: diff --git a/libgfortran/intrinsics/random.c b/libgfortran/intrinsics/random.c index 9b54a02..21395ea 100644 --- a/libgfortran/intrinsics/random.c +++ b/libgfortran/intrinsics/random.c @@ -787,7 +787,7 @@ random_seed_i4 (GFC_INTEGER_4 *size

[Patch, libfortran] Multi-threaded random_number

2016-07-24 Thread Janne Blomqvist
Hi, the attached patch replaces the current random_number / random_seed implementations with an implementation that better supports threads. It's an improved version of the RFC patch I posted earlier at https://gcc.gnu.org/ml/gcc-patches/2015-12/msg02110.html . Please see that earlier message for