6. processes and threads

Download 6. processes and threads

If you can't read please download the document

Upload: marian-marinov

Post on 16-Apr-2017

2.066 views

Category:

Education


0 download

TRANSCRIPT

Hardware - OS course @ Telerik Software Academy

6 Processes and Threads

Marian MarinovCEO of 1H [email protected]

Borislav VaradinovSystem Administratorbobi [ at ] itp.bg

What is a Process?

What is a Process?

Single process OS Arduino

Multy process OS Any modern kernel

What is a Process?

MEMORYCPUI/OAPPLICATION

Multiple Processes?

MEMORYCPUI/OAPPLICATION

APPLICATION

MEMORY

Multiple Processes?

Segmentation Fault

Bus Error

Access violation

SEGFAULT/SIGSEGV

Since Linux 3.2 CROSS MEMORY ATTACH

What is a Thread?

What is a Thread?

MEMORYCPUI/OThread1

Thread0

Process

What is a Thread?

Creating a process

FORK Copy the memory of the parent

Inherit FD table

Inherit credentials

Inherit security

EXEC Create new memory space

Inherit FD table

Inherit credentials

What is a Thread?

Creating a process

#include #include int main() {int i;pid_t p;p = fork();if (p == 0) {for (i=0;i