Re: Go patch committed: Multiplex goroutines onto OS threads

2012-02-10 Thread Ian Lance Taylor
Rainer Orth writes: > * On Solaris 8/x86 with native TLS, SETCONTEXT_CLOBBERS_TLS was > incorrectly defined, causing a proc.c compilation failure: > > /vol/gcc/src/hg/trunk/local/libgo/runtime/proc.c:105:4: error: #error unknown > case for SETCONTEXT_CLOBBERS_TLS > /vol/gcc/src/hg/trunk/local/

Re: Go patch committed: Multiplex goroutines onto OS threads

2012-02-10 Thread Rainer Orth
Ian Lance Taylor writes: > Ian Lance Taylor writes: > >> Right now it looks like there is a bug, or at least an incompatibility, >> in the 64-bit versions of getcontext and setcontext. It looks like >> calling setcontext on the 32-bit version does not change the value of >> TLS variables, which

Re: Go patch committed: Multiplex goroutines onto OS threads

2012-02-07 Thread Ian Lance Taylor
Ian Lance Taylor writes: > Right now it looks like there is a bug, or at least an incompatibility, > in the 64-bit versions of getcontext and setcontext. It looks like > calling setcontext on the 32-bit version does not change the value of > TLS variables, which is also the case on GNU/Linux. I

Re: Go patch committed: Multiplex goroutines onto OS threads

2012-01-18 Thread Rainer Orth
Ian Lance Taylor writes: > Rainer Orth writes: > >> All tests hang with the default -test.timeout=240. > > Thanks for providing access to a Solaris system. > > Right now it looks like there is a bug, or at least an incompatibility, > in the 64-bit versions of getcontext and setcontext. It loo

Re: Go patch committed: Multiplex goroutines onto OS threads

2012-01-18 Thread Ian Lance Taylor
Rainer Orth writes: > All tests hang with the default -test.timeout=240. Thanks for providing access to a Solaris system. Right now it looks like there is a bug, or at least an incompatibility, in the 64-bit versions of getcontext and setcontext. It looks like calling setcontext on the 32-bi

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-14 Thread Paolo Bonzini
On 12/14/2011 05:04 PM, Ian Lance Taylor wrote: > The OpenBSD thread runtime. It's similar to old LinuxThreads, but > with only 1 kernel thread per process IIUC. Oh, hmmm, that might be a problem. The other Go compiler seems to use the rfork system call to create new threads, passing RFPROC

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-14 Thread Ian Lance Taylor
Paolo Bonzini writes: > On 12/14/2011 04:45 PM, Ian Lance Taylor wrote: >>> > - sigaltstack always returns EINVAL when using threads; >> That is odd. sigaltstack is very useful when using threads. >> >>> > - the threads are identified by the runtime from their stack pointer, >>> > so you risk

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-14 Thread Paolo Bonzini
On 12/14/2011 04:45 PM, Ian Lance Taylor wrote: > - sigaltstack always returns EINVAL when using threads; That is odd. sigaltstack is very useful when using threads. > - the threads are identified by the runtime from their stack pointer, > so you risk confusing the runtime very much if you

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-14 Thread Ian Lance Taylor
Paolo Bonzini writes: > On 12/14/2011 04:00 PM, Ian Lance Taylor wrote: >> >> The other Go compiler already supports OpenBSD, so it must be possible >> in some sense. > > Do they have specialised code for OpenBSD? I said "it cannot work" in > the sense that: > > - *context functions are not ther

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-14 Thread Paolo Bonzini
On 12/14/2011 04:00 PM, Ian Lance Taylor wrote: > > This implementation relies on the functions getcontext, setcontext, and > > makecontext. If there are systems which don't have those, getcontext > > and setcontext can be replaced by setjmp and longjmp, but there is no > > obvious replaceme

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-14 Thread Ian Lance Taylor
Peter Maydell writes: > On 14 December 2011 15:00, Ian Lance Taylor wrote: >> Anyhow, makecontext is easy to write in a system specific manner.  It >> doesn't even have to be written in assembler, though getcontext and >> setcontext do have to be assembler.  Why not just implement them for >> AR

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-14 Thread Peter Maydell
On 14 December 2011 15:00, Ian Lance Taylor wrote: > Anyhow, makecontext is easy to write in a system specific manner.  It > doesn't even have to be written in assembler, though getcontext and > setcontext do have to be assembler.  Why not just implement them for > ARM? We're looking at implement

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-14 Thread Ian Lance Taylor
Paolo Bonzini writes: > On 11/28/2011 06:46 AM, Ian Lance Taylor wrote: >> This implementation relies on the functions getcontext, setcontext, and >> makecontext. If there are systems which don't have those, getcontext >> and setcontext can be replaced by setjmp and longjmp, but there is no >> o

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-14 Thread Ian Lance Taylor
Uros Bizjak writes: > Still no success, now I get: > > --- FAIL: runtime_test.TestGcSys (4.21 seconds) > ???:1: used 2554104 extra bytes > ???:1: using too much memory: 2554104 bytes > FAIL > FAIL: runtime Yeah, I was too aggressive. It had to be fixed in the master library too.

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-14 Thread Paolo Bonzini
On 11/28/2011 06:46 AM, Ian Lance Taylor wrote: This implementation relies on the functions getcontext, setcontext, and makecontext. If there are systems which don't have those, getcontext and setcontext can be replaced by setjmp and longjmp, but there is no obvious replacement for makecontext.

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-14 Thread Uros Bizjak
On Wed, Dec 14, 2011 at 12:15 AM, Ian Lance Taylor wrote: >>> This patch changes the Go library to multiplex goroutines onto operating >>> system threads.  Previously, each new goroutine ran in a separate >>> thread.  That is inefficient for programs with lots of goroutines.  This >>> patch chang

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-13 Thread Ian Lance Taylor
Uros Bizjak writes: >> This patch changes the Go library to multiplex goroutines onto operating >> system threads. Previously, each new goroutine ran in a separate >> thread. That is inefficient for programs with lots of goroutines. This >> patch changes the library such that it runs a certain

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-13 Thread Ian Lance Taylor
Rainer Orth writes: > Only a few minor compilation problems, fixed with the following patch. Thanks. Committed. Ian

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-13 Thread Rainer Orth
Ian Lance Taylor writes: > Rainer Orth writes: > >> Ian Lance Taylor writes: >> >>> Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Tested >>> both with and without -fsplit-stack support. Committed to mainline. >> >> Once Go bootstrap works again on Solaris, I notice that there

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-13 Thread Ian Lance Taylor
Rainer Orth writes: > Ian Lance Taylor writes: > >> of any differences between Solaris and GNU/Linux when it comes to the >> getcontext, setcontext, and makecontext functions? > > I've just found something in Solaris 11 makecontext(3C) (NOTES section), > but that doesn't explain why 32-bit Solar

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-13 Thread Rainer Orth
Ian Lance Taylor writes: > Rainer Orth writes: > >> Ian Lance Taylor writes: >> >>> Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Tested >>> both with and without -fsplit-stack support. Committed to mainline. >> >> Once Go bootstrap works again on Solaris, I notice that there

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-12 Thread Ian Lance Taylor
Rainer Orth writes: > Ian Lance Taylor writes: > >> Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Tested >> both with and without -fsplit-stack support. Committed to mainline. > > Once Go bootstrap works again on Solaris, I notice that there are many > 64-bit testsuite failure

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-12 Thread Rainer Orth
Ian Lance Taylor writes: > Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Tested > both with and without -fsplit-stack support. Committed to mainline. Once Go bootstrap works again on Solaris, I notice that there are many 64-bit testsuite failures, which have been introduced be

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-12 Thread Rainer Orth
Uros Bizjak writes: > For some reason I get this failure on alphaev68-pc-linux-gnu: > > --- FAIL: runtime_test.TestGcSys (4.64 seconds) > using 64 MB > using too much memory: 64 MB I see the same on Solaris/x86: --- FAIL: runtime_test.TestGcSys (2.76 seconds) using 63 MB

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-01 Thread Ian Lance Taylor
Rainer Orth writes: > Unfortunately, this patch broke Solaris bootstrap (and would break IRIX > bootstrap if this ever started working again): > > /vol/gcc/src/hg/trunk/local/libgo/runtime/go-signal.c:221:1: error: > conflicting types for 'sigignore' > In file included from > /vol/gcc/src/hg/tr

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-12-01 Thread Rainer Orth
Ian Lance Taylor writes: > This patch changes the Go library to multiplex goroutines onto operating > system threads. Previously, each new goroutine ran in a separate > thread. That is inefficient for programs with lots of goroutines. This > patch changes the library such that it runs a certai

Re: Go patch committed: Multiplex goroutines onto OS threads

2011-11-28 Thread Uros Bizjak
Hello! > This patch changes the Go library to multiplex goroutines onto operating > system threads. Previously, each new goroutine ran in a separate > thread. That is inefficient for programs with lots of goroutines. This > patch changes the library such that it runs a certain numbers of > thre