<commit_before>##Table of Content
####[1. Process](#process)
####[2. Process Synchronization](#process-synchronization)
####[3. Semaphores](#semaphores)
####[4. Monitor](#monitor)
####[5. Static Numbers](#static-numbers)
####[6. Relational SQL vs NoneSQL](#relationalsqlvsnonesql)

## Process
#### Independent process and cooperating process 
* A process is cooperating if it can affect or be affected by the other processes executing in the system.
* Cooperating processes require an interprocess communication (IPC) mechanism that will allow them to exchange data and information. 
* Advantage for the cooperation process: Information sharing, Computation speedup, Modularity, Convenience 
* There are two fundamental models of interprocess communication: shared memory and message passing.

##### Shared memory vs Message passing 
| Share memory | Message passing |
| --- | --- |
| More faster, since message-passing systems are typically implemented using system calls thus require the more time-consuming task of kernel intervention | Message passing is useful for exchanging smaller amounts of data, because no conflicts need be avoided.|
|In shared-memory systems, system calls are required only to establish shared memory regions. Once shared memory is established, all accesses are treated as routine memory accesses, and no assistance from the kernel is required | easier to implement in a distributed system than shared memory | 

##### Shared memory 

＊ To allow producer and consumer processes to run concurrently, we must have available a buffer of items that can be filled by the producer and emptied by the consumer. This buffer will reside in a region of memory that is shared by the producer and consumer processes.

＊ Two types of buffers can be used. The unbounded buffer places no practical limit on the size of the buffer. The consumer may have to wait for new items, but the producer can always produce new items. The bounded buffer assumes a fixed buffer size. In this case, the consumer must wait if the buffer is empty, and the producer must wait if the buffer is full.

##### Message-Passing Systems
* Use the mailbox 

####[ Google Chome Multi-process architecture](https://www.chromium.org/developers/design-documents/multi-process-architecture)
* Browser process
* Renderer process
* plug-in process 

![pic](https://cloud.githubusercontent.com/assets/9062406/7449415/8d6808bc-f1ea-11e4-9b14-3f147f0f0d18.png)

## Process Synchronization<commit_msg>Update System_Design_OS_Basic.md<commit_after>##Table of Content
####[1. Process](#process)
####[2. Process Synchronization](#process-synchronization)
####[3. Semaphores](#semaphores)
####[4. Monitor](#monitor)
####[5. Static Numbers](#static-numbers)
####[6. Relational SQL vs NoneSQL](#relational-sql-vs-nonesql)

## Process
#### Independent process and cooperating process 
* A process is cooperating if it can affect or be affected by the other processes executing in the system.
* Cooperating processes require an interprocess communication (IPC) mechanism that will allow them to exchange data and information. 
* Advantage for the cooperation process: Information sharing, Computation speedup, Modularity, Convenience 
* There are two fundamental models of interprocess communication: shared memory and message passing.

##### Shared memory vs Message passing 
| Share memory | Message passing |
| --- | --- |
| More faster, since message-passing systems are typically implemented using system calls thus require the more time-consuming task of kernel intervention | Message passing is useful for exchanging smaller amounts of data, because no conflicts need be avoided.|
|In shared-memory systems, system calls are required only to establish shared memory regions. Once shared memory is established, all accesses are treated as routine memory accesses, and no assistance from the kernel is required | easier to implement in a distributed system than shared memory | 

##### Shared memory 

＊ To allow producer and consumer processes to run concurrently, we must have available a buffer of items that can be filled by the producer and emptied by the consumer. This buffer will reside in a region of memory that is shared by the producer and consumer processes.

＊ Two types of buffers can be used. The unbounded buffer places no practical limit on the size of the buffer. The consumer may have to wait for new items, but the producer can always produce new items. The bounded buffer assumes a fixed buffer size. In this case, the consumer must wait if the buffer is empty, and the producer must wait if the buffer is full.

##### Message-Passing Systems
* Use the mailbox 

####[ Google Chome Multi-process architecture](https://www.chromium.org/developers/design-documents/multi-process-architecture)
* Browser process
* Renderer process
* plug-in process 

![pic](https://cloud.githubusercontent.com/assets/9062406/7449415/8d6808bc-f1ea-11e4-9b14-3f147f0f0d18.png)

## Process Synchronization
{'fraction_non_alphanumeric': 0.07710843373493977, 'fraction_numerical': 0.01606425702811245, 'mean_word_length': 5.044902912621359, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '814480', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1188, 'n_words': 618}