next up previous contents
Next: Appendix: Deadlock Alternatives Up: 4560 Previous: UNIX: System Design   Contents

Mach Design [292]





Mach: What about UNIX? [293]

UNIX good points:



Mach: Basic Goals [294]



Mach: Structure and Emulation [295]





\begin{picture}(630,289)(0,540)
\thicklines\put(500,720){\line(-1, 0){100}}
\put...
...}}
\put(275,545){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{IPC}}}
\end{picture}






Mach: UNIX Emulation in Mach [296]





\begin{picture}(640,260)(60,560)
\thicklines\put(240,740){\circle{44}}
\put(520,...
...][0pt]{1. UNIX binary traps to the kernel to make a system call}}}
\end{picture}






Mach: Primitive Abstractions [297]



Mach: Primitive Abstractions [298]



Summary of Primitive Abstractions [299]





\begin{picture}(655,414)(-5,410)
\thicklines\put(430,740){\oval(12,32)}
\put(430...
...5,515){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{memory object}}}
\end{picture}



Mach: Blend Memory and IPC [300]



Mach: Process Management - Tasks [301]



Mach: Process Management - Threads [302]



Mach: Thread Synchronization [303]



Producer-Consumer Synchronization [304]

INITIALIZATION:
int buffer[MAXBUF];     int buf_ptr  = -1;
int nonempty = FALSE;   int nonfull  = TRUE;
mutex_alloc(mutex,1);   condition_alloc(nonempty,nonfull);

void add_buffer(int item) {                int rem_buffer() {
  buf_ptr++;                               int item = buffer[buf_ptr];
  buffer[buf_ptr] = item;                    buf_ptr--;
  empty = FALSE;                             full = FALSE;
  if (buf_ptr == MAXBUF-1) full = TRUE;      if (buf_ptr==-1) empty=TRUE;
}                                            return(item);
                                           }
PRODUCER:                                  CONSUMER:
while (1) {                                while (1) {
  nextp = produce_item();       
  mutex_lock(mutex);                         mutex_lock(mutex);
  while (full)                               while (empty)
    condition_wait(nonfull,mutex);             condition_wait(nonempty,mutex);
  add_buffer(nextp);                         nextc = rem_buffer();
  condition_signal(nonempty);                condition_signal(nonfull);
  mutex_unlock(mutex);                       mutex_unlock(mutex);
                                             consume_item(nextc);
}                                          }
TERMINATION: mutex_free(mutex); condition_free(nonempty,nonfull);



Mach: CPU Scheduling [305]



Mach: Ports [306]



Mach: Ports and Capabilities [307]





\begin{picture}(480,300)(60,520)
\thicklines\put(160,740){\circle{42}}
\put(150,...
...makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{capability list for B}}}
\end{picture}



Mach: Network Messages [308]





\begin{picture}(600,254)(80,570)
\thicklines\put(460,740){\circle{42}}
\put(440,...
...put(345,580){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{network}}}
\end{picture}






Mach: Messages [309]



Mach: Messages - Out-of-Line Data [310]





\begin{picture}(340,179)(60,640)
\thicklines\put(180,660){\framebox (20,120){}}
...
...,805){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{virtual memory}}}
\end{picture}



Mach: Memory Management [311]



Mach: Virtual Memory [312]



Mach: Address Map for Sparse VM [313]





\begin{picture}(670,440)(20,380)
\thicklines\put(210,720){\framebox (140,20){}}
...
...
\put(260,775){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{space}}}
\end{picture}



Distributed Shared Memory Server [314]





\begin{picture}(310,275)(45,539)
\thicklines\put(200,560){\circle{42}}
\put(180,...
...t(260,800){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{machine Y}}}
\end{picture}






Index to Slides: LEFT BLANK [315]



Index to Slides: LEFT BLANK [316]


next up previous contents
Next: Appendix: Deadlock Alternatives Up: 4560 Previous: UNIX: System Design   Contents
Ted Billard 2001-11-17