Start semaphoring out
This commit is contained in:
		@@ -1,2 +1,8 @@
 | 
			
		||||
 | 
			
		||||
void consumer ();
 | 
			
		||||
/*
 | 
			
		||||
   consumer:
 | 
			
		||||
      Unlinks blocks from list2,
 | 
			
		||||
      Consumes them,
 | 
			
		||||
      Links them to freelist
 | 
			
		||||
*/
 | 
			
		||||
void *consumer (void *);
 | 
			
		||||
@@ -4,4 +4,9 @@
 | 
			
		||||
extern block memory[N];
 | 
			
		||||
// create the three lists
 | 
			
		||||
extern list lists[3];
 | 
			
		||||
extern list *freelist, *list1, *list2;
 | 
			
		||||
extern list *freelist, *list1, *list2;
 | 
			
		||||
 | 
			
		||||
// count semaphores
 | 
			
		||||
extern sem_t semfl, seml1, seml2;
 | 
			
		||||
// binary semaphores
 | 
			
		||||
extern sem_t mutfl, mutl1, mutl2;
 | 
			
		||||
@@ -20,5 +20,4 @@ void   list_link   (list *l, block *b);
 | 
			
		||||
//   list_init:   links an array of blocks onto the end of a list
 | 
			
		||||
void   list_init   (list *l, block *m, int size);
 | 
			
		||||
//   list_print:  prints a list
 | 
			
		||||
void   list_print  (list *l);
 | 
			
		||||
void   list_concise(list *l);
 | 
			
		||||
void   list_print(list *l, bool verbose = false);
 | 
			
		||||
@@ -1,2 +1,8 @@
 | 
			
		||||
 | 
			
		||||
void producer ();
 | 
			
		||||
/*
 | 
			
		||||
   producer:
 | 
			
		||||
      Unlinks blocks from freelist,
 | 
			
		||||
      Produces them,
 | 
			
		||||
      Links them to list1
 | 
			
		||||
*/
 | 
			
		||||
void *producer (void *);
 | 
			
		||||
@@ -1,2 +1,10 @@
 | 
			
		||||
 | 
			
		||||
void transformer ();
 | 
			
		||||
/*
 | 
			
		||||
   transformer:
 | 
			
		||||
      Unlinks block x from list1
 | 
			
		||||
      Unlinks block y from freelist
 | 
			
		||||
      Uses block x to generate block y's data
 | 
			
		||||
      Links block x to freelist
 | 
			
		||||
      Links block y to list2
 | 
			
		||||
*/
 | 
			
		||||
void *transformer (void *);
 | 
			
		||||
		Reference in New Issue
	
	Block a user