summaryrefslogtreecommitdiff
path: root/src/runtime/proc.c
AgeCommit message (Collapse)AuthorFilesLines
2009-06-06move src/runtime -> src/lib/runtime;Russ Cox1-858/+0
only automatic g4 mv here. R=r OCL=30002 CL=30007
2009-06-0232-bit fixes in lessstack.Russ Cox1-13/+12
avoid tight coupling between deferreturn and jmpdefer. before, jmpdefer knew the exact frame size of deferreturn in order to pop it off the stack. now, deferreturn passes jmpdefer a pointer to the frame above it explicitly. that avoids a magic constant and should be less fragile. R=r DELTA=32 (6 added, 3 deleted, 23 changed) OCL=29801 CL=29804
2009-05-2632-bit stack switching bug fixRuss Cox1-1/+1
R=ken OCL=29412 CL=29412
2009-05-08move things out of sys into os and runtimeRuss Cox1-6/+24
R=r OCL=28569 CL=28573
2009-04-13runtime nits: variable name and commentsRuss Cox1-10/+10
R=r DELTA=10 (0 added, 0 deleted, 10 changed) OCL=27374 CL=27388
2009-04-02clarification suggested by robRuss Cox1-0/+4
R=r DELTA=4 (4 added, 0 deleted, 0 changed) OCL=26983 CL=27041
2009-04-01fix runtime stack overflow bug that gri ran into:Russ Cox1-152/+208
160 - 75 was just barely not enough for deferproc + morestack. added enum names and bumped to 256 - 128. added explanation. changed a few mal() (garbage-collected) to malloc()/free() (manually collected). R=ken OCL=26981 CL=26981
2009-03-30more 386 runtime - can run tiny c programs.Russ Cox1-3/+3
R=r DELTA=1926 (1727 added, 168 deleted, 31 changed) OCL=26876 CL=26878
2009-01-28Use explicit allspan list instead ofRuss Cox1-4/+4
trying to find all the places where spans might be recorded. Free can cascade into complicated span manipulations that move them from list to list; the old code had the possibility of accidentally processing a span twice or jumping to a different list, causing an infinite loop. R=r DELTA=70 (28 added, 25 deleted, 17 changed) OCL=23704 CL=23710
2009-01-27pragma textflagKen Thompson1-0/+4
fixes latent bugs in go and defer R=r OCL=23613 CL=23613
2009-01-27various race conditions.Russ Cox1-1/+5
R=r DELTA=43 (29 added, 5 deleted, 9 changed) OCL=23608 CL=23611
2009-01-27deferKen Thompson1-1/+36
R=r OCL=23592 CL=23592
2009-01-26gc #0. mark and sweep collector.Russ Cox1-3/+6
R=r,gri DELTA=472 (423 added, 2 deleted, 47 changed) OCL=23522 CL=23541
2009-01-16casify, cleanup sysRuss Cox1-7/+8
R=r OCL=22978 CL=22984
2008-12-19malloc bug fixes.Russ Cox1-1/+5
use malloc by default. free stacks. R=r DELTA=424 (333 added, 29 deleted, 62 changed) OCL=21553 CL=21584
2008-12-18malloc in runtime (not used by default)Russ Cox1-0/+5
R=r DELTA=1551 (1550 added, 0 deleted, 1 changed) OCL=21404 CL=21538
2008-12-08use Note sched.stopped correctlyRuss Cox1-1/+6
R=r DELTA=6 (5 added, 0 deleted, 1 changed) OCL=20777 CL=20779
2008-12-05add support for ref counts to memory allocator.Russ Cox1-3/+40
mark and sweep, stop the world garbage collector (intermediate step in the way to ref counting). can run pretty with an explicit gc after each file. R=r DELTA=502 (346 added, 143 deleted, 13 changed) OCL=20630 CL=20635
2008-12-04add stub routines stackalloc() and stackfree().Russ Cox1-7/+30
run oldstack on g0's stack, just like newstack does, so that oldstack can free the old stack. R=r DELTA=53 (44 added, 0 deleted, 9 changed) OCL=20404 CL=20433
2008-11-25change meaning of $GOMAXPROCS to number of cpus to use,Russ Cox1-62/+153
not number of threads. can still starve all the other threads, but only by looping, not by waiting in a system call. fix darwin syscall.Syscall6 bug. fix chanclient bug. delete $GOMAXPROCS from network tests. add stripped down printf, sys.printhex to runtime. R=r DELTA=355 (217 added, 36 deleted, 102 changed) OCL=20017 CL=20019
2008-09-26go/acid/goRuss Cox1-3/+3
R=r DELTA=99 (95 added, 1 deleted, 3 changed) OCL=15983 CL=15992
2008-09-24get rid of per-G Note, avoids per-G kernel semaphore on Mac.Russ Cox1-13/+17
2.14u 19.82s 22.17r 6.out 100000 # old 1.87u 0.43s 2.31r 6.out 100000 # new R=r OCL=15762 CL=15772
2008-09-18proper handling of signals.Russ Cox1-30/+46
do not run init on g0. R=r DELTA=161 (124 added, 23 deleted, 14 changed) OCL=15490 CL=15497
2008-09-17add network listening & testsRuss Cox1-1/+1
R=r,presotto OCL=15410 CL=15440
2008-09-09go threads for OS XRuss Cox1-3/+1
R=r OCL=14944 CL=15013
2008-09-08fix bug in stack limit calculation - was setting limit reg in wrong place.Rob Pike1-8/+3
R=ken OCL=14981 CL=14981
2008-08-05kill trailing white space.Russ Cox1-17/+17
(apparently my first attempt didn't work.) R=r OCL=13888 CL=13888
2008-08-05* comment, clean up schedulerRuss Cox1-175/+285
* rewrite lock implementation to be correct (tip: never assume that an algorithm you found in a linux man page is correct.) * delete unneeded void* arg from clone fn * replace Rendez with Note * comment mal better * use 6c -w, fix warnings * mark all assembly functions 7 R=r DELTA=828 (338 added, 221 deleted, 269 changed) OCL=13884 CL=13886
2008-08-04first cut at multithreading. works on Linux.Russ Cox1-25/+198
* kick off new os procs (machs) as needed * add sys·sleep for testing * add Lock, Rendez * properly lock mal, sys·newproc, scheduler * linux syscall arg #4 is in R10, not CX * chans are not multithread-safe yet * multithreading disabled by default; set $gomaxprocs=2 (or 1000) to turn it on This should build on OS X but may not. Rob and I will fix soon after submitting. TBR=r OCL=13784 CL=13842
2008-08-02slightly gratuitous reorg of scheduler codeRuss Cox1-18/+20
* rename select (very loaded word) nextgoroutine * separate out "enter scheduler" (sys·gosched) from the scheduler itself (scheduler) R=r APPROVED=r DELTA=36 (17 added, 15 deleted, 4 changed) OCL=13772 CL=13774
2008-07-28print tracebacks for all goroutines, not just the crashing oneRob Pike1-0/+15
R=ken OCL=13518 CL=13518
2008-07-20start of selectKen Thompson1-25/+0
random bugs fixed SVN=128149
2008-07-17div bugKen Thompson1-6/+2
[]ptr bug proc reuses old g* structures differnt assignment of offsets to parameters SVN=127888
2008-07-16new (more fifo) schedulint algorithmKen Thompson1-13/+34
newproc will reuse dead procs SVN=127565
2008-07-14synch chanKen Thompson1-0/+264
SVN=127057