Assuming you mean the ability to call Go code from a thread started by
C: there are plans to add this functionality, but there is no schedule.
Of course this is something that anybody can work on, you don't have to
wait for us.
Ian
On the Unix side, I would say that if we get a call back to Go and the
thread-local m variable is nil, then the thread should create a new
goroutine calling the function, add the goroutine to the scheduling
list, and add some magic so that the thread can wait until the goroutine
terminates. It's conceptually simple, it's just has annoying details.
The first two steps are just runtime·newproc. The last step might be
implemented by, say, adding an optional note to a G structure and having
schedule call notewakeup when it finds a goroutine in Gmoribund state.
Note that before calling any runtime code the C thread needs to set up
the stack guard such that the Go functions won't try to ask for more
stack space.
Ian
Coincidently, Gustavo Barbieri (CCd) was asking me about this _today_
for implementing the EFL [1] support for Go.
Something I did before for solving that problem was to sustain a
blocked goroutine waiting for input from the C side for running logic
requested. The C side would then block holding for the handling of the
call from the Go side.
[1] http://www.enlightenment.org/
--
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/plus
http://niemeyer.net/twitter
http://niemeyer.net/blog
-- I'm not absolutely sure of anything.
Nice, thanks Alex.