plan 9 kernel history: overview | file list | diff list

1990/03091/port/proc.c (diff list | history)

1990/0309/sys/src/9/port/proc.c:195,2081990/03091/sys/src/9/port/proc.c:195,209 (short | long | prev | next)
Allocate process locks all at once rather than on-demand at possibly bad times. (See power/lock.c)

Code rearrangement: wakeme, twakeme.
rsc Tue Mar 21 00:14:32 2006

1990/0227    
	Proc *p; 
	int i; 
 
	print("procinit\n"); 
                 
	procalloc.free = ialloc(conf.nproc*sizeof(Proc), 0); 
	procalloc.arena = procalloc.free; 
 
	p = procalloc.free; 
	for(i=0; i<conf.nproc-1; i++,p++) 
1990/03091    
	for(i=0; i<conf.nproc-1; i++,p++){ 
		lock(p);	/* allocate now, not during wakeup */ 
		unlock(p); 
1990/0227    
		p->qnext = p+1; 
1990/03091    
	} 
1990/0227    
	p->qnext = 0; 
} 
 
1990/0309/sys/src/9/port/proc.c:288,2931990/03091/sys/src/9/port/proc.c:289,307
1990/0227    
	splx(s); 
} 
 
1990/03091    
void 
wakeme(Alarm *a) 
{ 
	ready((Proc*)(a->arg)); 
	cancel(a); 
} 
 
void 
twakeme(Alarm *a) 
{ 
	wakeup((Rendez*)(a->arg)); 
} 
 
1990/0227    
int 
postnote(Proc *p, int dolock, char *n, int flag) 
{ 
1990/0309/sys/src/9/port/proc.c:322,3401990/03091/sys/src/9/port/proc.c:336,341
1990/0227    
		splx(s); 
	} 
	return 1; 
} 
                 
void 
wakeme(Alarm *a) 
{ 
	ready((Proc*)(a->arg)); 
	cancel(a); 
} 
                 
void 
twakeme(Alarm *a) 
{ 
	wakeup((Rendez*)(a->arg)); 
} 
 
void 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)