Tải bản đầy đủ (.docx) (15 trang)

FULL Đồ án về PROCESSES AND THREADS

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (129.65 KB, 15 trang )

VIETNAM GENERAL CONFEDERATION OF LABOUR
TON DUC THANG UNIVERSITY
FACULTY OF INFORMATION TECHNOLOGY

INTRODUCTION TO
THE OPERATING SYSTEM ASSIGNMENT

SOLVE THE PROBLEM ABOUT
PROCESSES AND THREADS
(EVEN NUMBERS)
Supervisor: Ph.D. JAE YOUNG HUR
Ph.D. BHAGAWAN NATH
Student:

VÕ ĐĂNG PHƯỚC – 51600071
TRẦN HỮU PHÁT – 51600062

Class:

16050311

HO CHI MINH CITY, 2017


VIETNAM GENERAL CONFEDERATION OF LABOUR
TON DUC THANG UNIVERSITY
FACULTY OF INFORMATION TECHNOLOGY

INTRODUCTION TO
THE OPERATING SYSTEM ASSIGNMENT


KEY – VALUE DATABASE
(HADOOP,AMZON DYNAMO, VOLDERMORT)
Supervisor: Ph.D. JAE YOUNG HUR
Ph.D. BHAGAWAN NATH
Student:

VÕ ĐĂNG PHƯỚC – 51600071
TRẦN HỮU PHÁT – 51600062

Class:

16050311

HO CHI MINH CITY, 2018


1

ACKNOWLEDGEMENT
First of all, I would like to send to teachers of the Faculty of Information Technology greetings
and best wishes. Thanks to the classroom learning as well as the guidance of Ph.D. Jae Young
Hur and Ph.D. Bhagawan Nath, I was able to have the knowledge to complete my essay

on “ Solve the problem about processes and threads (even numbers) ” With the limited
knowledge of a student, I hope to receive advice, comments from teachers, so that I can
improve on skills as well as knowledge later. I sincerely thank.


2


ASSIGNMENT IS COMPLETED
AT TON DUC THANG UNIVERSITY
I pledge that this is my own essay product and is guided by Ph.D. Jae Young Hur
and Ph.D. Bhagawan Nath

The research contents, results in this topic are honest and not published in any
way before. The data in the tables used for the analysis, comment, and evaluation were
collected by the authors themselves from various sources indicated in the reference
section.
In addition, the project uses some comments, reviews as well as data from other
authors, other organizations have cited and annotated the source.
If any fraud is found, I am fully responsible for the content of my project. Ton
Duc Thang University is not involved in any copyright infringement or copyright
infringement in the course of implementation (if any).
Ho Chi Minh City, 30th November 2017
Author
(sign and write full name)

Võ Đăng Phước

Trần Hữu Phát


3


4

CERTIFICATE AND ASSESSMENT OF THE TEACHER
Confirmation of the instructor


_________________________________________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
Ho Chi Minh City, 30th November 2017
(Sign and write full name)

The assessment of the teacher marked

_________________________________________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
Ho Chi Minh City, 30th November 2017
(Sign and write full name)


5

SUMMARY
To avoid interruptions, the operating system provides parallel running processes.
These processes generate and end automatically. Each processes have their own
address space.

For an application, it works better when they are controlled by multiple single
threads in one process. These threads are independently and its own stack, but all
threads in the process share common address space. Threads can be implemented in
user space or in the kernel.
Processes can communicate with one another using protocols that communicate
between processes, such as semaphores, monitors, or messages. These primitives are
used to ensure that no process occurs in critical areas at the same time, a situation that
leads to chaos. A process can be running, runnable or blocked and can change state
when it or another process executes one of the communication prototypes between
processes. Interthread communication is similar.
Interprocess communication primitives can be used to solve such problems as
the producer-consumer, dining philosophers, reader-writer, and sleeping barber. Even
with these primitives, care has to be taken to avoid errors and deadlocks.
Interprocess communication primitives can be used to solve a lot of problems.
Somtimes, it has to be taken to avoid errors and deadlocks


1

CONTENTS
ACKNOWLEDGEMENT...............................................................................................i
ASSIGNMENT IS COMPLETED AT TON DUC THANG UNIVERSITY..................ii
CERTIFICATE AND ASSESSMENT OF THE TEACHER.........................................iii
SUMMARY..................................................................................................................iv
CONTENTS...................................................................................................................1
LIST OF SIGNS AND ABBREVIATIONS....................................................................3
LIST OF TABLES, FIGURES AND CHARTS..............................................................4
CHAPTER 1 - KEY.......................................................................................................5
1.1


Introduction..............................................................................................5
1.1.1 Primary Key..................................................................................5
1.1.1.1 Set primary key............................................................................5
1.1.1.2 Delete primary key.......................................................................5

1.1.2 Foreign Key...................................................................................5

1.1.3

1.1.2.1Set foreign key..............................................................................5
1.1.2.2Delete foreign key.........................................................................5
Compare...................................................................................................5

1.2 Some other keys.............................................................................................5
1.2.1 Simple lock.................................................................................................5
1.2.1.1 Live lock......................................................................................5
1.2.1.2 Dead lock.....................................................................................5
1.2.2 Lock read/write..........................................................................................5

CHAPTER 2 – VALUE..................................................................................................6
2.1........................................................................................................................ 6
REFERENCE...............................................................................................................16


2


3

LIST OF SIGNS AND ABBREVIATIONS

SIGNS:
ABBREVIATIONS:


4

LIST OF TABLES, FIGURES AND CHARTS
CATEGORY LIST:
LIST OF TABLES:


5

CHAPTER 1 - KEY
1.1Introduction
Key use to execute all vounted data in SQL Server and this database are
important of database objects.
1.1.1 Primary Key
The primary key (or constrauling primary key) used to determine the
unique list each records in the database of table.
Data of field primary key must be unique only and contain NOT NULL.

1.1.1.1Set primary key
We use command:
AFTER TABLE ..’name table’... ADD PRIMARY KEY(....’field in
table’..)
And remember primary key must NOT NULL.
1.1.1.2 Delete primary key
We use command:
AFTER TABLE ..’name table’... DROP PRIMARY KEY

1.1.2 Foreign Key
The foreign key of a table is considered a pointer to the primary key of another
table. It is used to connect two table together.


6

1.1.2.1 Set foreign key
We use command:
AFTER TABLE ...’name table’.... ADD
CONSTRAINT..’field’..FOREIGN KEY..’name table’...(...’field in contain foreign
key’...)
1.1.2.2 Delete foreign key
We use command:
AFTER TABLE .....’name table’..... DROP FOREIGN KEY..’field’...
1.1.3 Compare
Primay key
Primary key uniquely identifies a
record in the table.
Primary keys do not accept null
values.
By default, the primary key is a
clustered index and the data in the
database table is organized in the order
of the clustered indexes.
We can only have one primary key in
a table.

1.2 Some other keys
1.2.1 Simple lock


Foreign key
Foreign key is a field in the table and is
a primary key in another table.
Foreign keys can accept multiple null
values.
Foreign keys do not automatically
create an index, group, or group. You
can create an index on a foreign key.
We can have multiple foreign keys in a
table.


7

Before applying to A, you must apply for A lock (A). If the request for a lock is
approved, it is processed to A
After the operation is complete with A, release the command A Unlock release (A)
Lock manager will allow us lock (A) if A free.
1.2.1.1 Live lock
Appearance status lock but when the lock unlock someone else will lead to
have to continue waiting for the key lock.
1.2.1.2 Dead lock
For example:
T1 ask lock(A), T2 ask lock (B), after T1 need lock(B) it is in the waiting state
T2 also needs A so ask lock (A) and wait also.
 leading to crashes.
Prevent deadlock:
If a transaction starts, you will need to lock the "all" key and then do the operation. If
so, then manipulate otherwise wait. Another way is the admin will intervene and see which

program is more important then priority.
But the above methods are still not optimized.
1.2.2 Lock read/write
To read A must request readlock (A), readlook is also called sharedlock.
To write A must request writelock (A). The writelock is also called exlisivelock.
A readlock request is accepted if no one has kept writelock.


8

Also a writelock request is accepted when no one has kept writelock or readlock.

CHAPTER 2 – VALUE
2.1

REFERENCE
1. />2. a/p/khac-biet-giua-khoa-chinh-va-khoa-ngoai-trong-sql-

924lJMdWZPM
3. />


×