Large number of goroutines on PowerPC

96 views
Skip to first unread message

Conrado PLG

unread,
Nov 17, 2017, 6:31:16 AM11/17/17
to golang-nuts
Hi,

I'm working on a software for a 32-bit PowerPC processor. Since there is no Go support for it, I'm using gccgo. However, I've noticed that it's not possible to use a large number of goroutines since each one takes around 2 MB of memory. From what I understand, this is the stack space reserved for each goroutine, and it's large because gccgo does not support split stack for non-x86 processors.

My questions are:

- Is there a way to reduce the stack usage of goroutines (even if it requires recompiling gccgo)?

- How difficult would it be to port Go to 32-bit PowerPC (Linux)? Could someone give a high-level overview of what would need to be changed (or is there an overview somewhere)?

Thanks!


Ian Lance Taylor

unread,
Nov 17, 2017, 2:29:08 PM11/17/17
to Conrado PLG, golang-nuts
On Fri, Nov 17, 2017 at 3:31 AM, Conrado PLG <conra...@gmail.com> wrote:
>
> I'm working on a software for a 32-bit PowerPC processor. Since there is no
> Go support for it, I'm using gccgo. However, I've noticed that it's not
> possible to use a large number of goroutines since each one takes around 2
> MB of memory. From what I understand, this is the stack space reserved for
> each goroutine, and it's large because gccgo does not support split stack
> for non-x86 processors.
>
> My questions are:
>
> - Is there a way to reduce the stack usage of goroutines (even if it
> requires recompiling gccgo)?

Edit StackMin (for the non-split-stack case) in libgo/runtime/proc.c
and rebuild libgo.

Note that GCC does support split stacks for 64-bit PPC. I don't know
how difficult it would be to add support for 32-bit PPC.


> - How difficult would it be to port Go to 32-bit PowerPC (Linux)? Could
> someone give a high-level overview of what would need to be changed (or is
> there an overview somewhere)?

It probably wouldn't be too hard for someone familiar with PPC32 and
PPC64 as used on GNU/Linux. Basically look for every file in the Go
distribution with "ppc64" in the name, and plan to write a plan "ppc"
version.

Ian
Reply all
Reply to author
Forward
0 new messages