====== Notes by MC ====== ===== Links ===== * http://doc.cat-v.org/plan_9/4th_edition/papers/compiler * ''extern register'' * [[http://groups.google.com/group/golang-nuts/browse_thread/thread/df8b124cf31e124a|"callbacks" attempts ("Out-of-band callbacks with cgo")]] * other [[http://groups.google.com/group/golang-nuts/browse_thread/thread/34d6a5b928242d25/2c786e7691b5bad1?q=#2c786e7691b5bad1|notes]], probably related * blog entry [[http://cheesesun.blogspot.com/2010/04/callbacks-in-cgo.html|on cgo callbacks]], dated 24.04.2010. * CL 834045 - [[http://codereview.appspot.com/834045|"Library support for cgo export"]]. * introduces ''startcgocallback()'', ''endcgocallback()'' in ''runtime/proc.c'', ''cgocallback()'' in ''runtime/cgocall.c'', ''runcgocallback()'' in ''runtime/386/asm.s''. * (supposedly) related golang-nuts announcement post: [[http://groups.google.com/group/golang-nuts/browse_thread/thread/abd0e30dafdbf297|"cgo callbacks"]] * CL 1696051 - [[http://codereview.appspot.com/1696051/|"runtime: implementation of callback functions for windows"]] - not accepted yet * ''_beginthread()'' vs. ''CreateThread()'' - [[http://www.codeguru.com/forum/archive/index.php/t-433100.html|a discussion on differences]] ===== Source files ===== * ''runtime/windows/thread.c'' * ''syscall(...)'' * ''stdcall(...)'' * ''newosproc(...)'' * ''get_proc_addr(...)'', ''get_proc_addr2(...)'' * ''runtime/windows/sys.s'' * ''stdcall_raw(...)'' * ''get_kernel_module(...)'' * ''runtime/386/asm.h'' * ''get_tls(register)'' * ''runtime/windows/syscall.goc'' * see also: ''goc2c.c'', ''Makefile'' * ''runtime/proc.c'' * ''tracebackothers(...)'', ''entersyscall(...)'' * ''runtime/cgocall.c'' * ''cgocall(...)'', ''cgocallback(...)'' * ''runtime/runtime.h'' * ''M'', ''G'', ''m'', ''g'' ===== Various quotes etc. ===== * The number of goroutines actively running is the number of ''M'' structures that are running. Look at ''runtime·sched'' for various useful counts and lists. [[http://groups.google.com/group/golang-nuts/msg/ac6bd8525276e543|(link)]] * To find the goroutines that exist, whether or not they are running, start at ''runtime·allg'' and walk through the ''alllink field''. Don't count the ones whose status field ''== Gdead''. [[http://groups.google.com/group/golang-nuts/msg/ac6bd8525276e543|(link)]]