Module 7: Process Synchronization

Size: px
Start display at page:

Download "Module 7: Process Synchronization"

Transcription

1 Chapter 6: Process Synchronization ( 프로세스동기화 ), Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

2 Module 6: Synchronization( 동기화 ) Background( 배경 ) The Critical-Section Problem( 임계구역문제 ) Peterson s Solution( 피터슨솔루션 ) Synchronization Hardware( 동기화하드웨어 ) Semaphores( 세마포 ) Classic Problems of Synchronization( 고전적동기화문제들 ) Monitors( 모니터 ) Synchronization Examples ( 동기화사례 ) Atomic Transactions( 원자적트랜잭션 ) 6.2 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

3 Summary Background( 배경 ) 개념 2 examples of a problem caused by wrong synchronization between processes Producer-Consumer problem Withdraw money from a bank account The Critical-Section Problem( 임계구역문제 ) 임계구역이란? / 3 requirements / 임계구역를다루는구조 Mechanism for the critical section problems: Locks, Semaphores, Monitors, Locks Acquire(a lock), Release(the lock), atomic operation(load, Store) Solution using Software Algorithm Peterson s Solution for two processes Bakery algorithm for more than two processes Solution using hardware atomic instructions(test-and-set, compare-and-swap) Mutual Exclusion solution Bounded mutual exclusion solution Disable/enable interrupts 6.3 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

4 Summary Semaphores( 세마포 ) Semaphore S, wait, signal Binary semaphore and Counting Semaphore and implementation examples Solution without Busy-Waiting : Block and Wakeup operations Deadlock and Starvation Classic Problems of Synchronization( 고전적동기화문제들 ) Bounded-Buffer producer-consumer Problem Reader-writer problem Dining-Philosophers problem Monitors( 모니터 ) Synchronization Examples ( 동기화사례 ) Atomic Transactions( 원자적트랜잭션 ) 6.4 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

5 Objectives 공유데이터의일관성을보장하기위한임계구역문제소개 (To introduce the critical-section problem, whose solutions can be used to ensure the consistency of shared data) 임계구역문제의소프트웨어및하드웨어솔루션 (To present both software and hardware solutions of the critical-section problem) 원자적트랜잭션의개념을소개하고원자성을보장하기위한매카니즘을기술한다. (To introduce the concept of an atomic transaction and describe mechanisms to ensure atomicity) Examples Produce-Consumer Problem Withdraw money from a bank account 6.5 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

6 Bounded Shared Buffer Previous Producer-Consumer (3.4.1) Producer process item nextproduced; while (true) /* Produce an item in nextproduced */ while ((((in + 1) % BUFFER_SIZE) == out) ; /* do nothing -- no free buffers */ buffer[in] = nextproduced; in = (in + 1) % BUFFER SIZE; Consumer process item nextconsumed; while (true) while (in == out) ; // do nothing -- nothing to consume nextconsumed = buffer[out]; // remove an item from the buffer out = (out + 1) % BUFFER SIZE; /* consume the item in nextconsume */ At most BUFFER_SIZE-1 items in the buffer of BUFFER_SIZE Shared Data #define BUFFER_SIZE 10 typedef struct... item; item buffer[buffer_size]; int in = 0; //used by producer int out = 0; //used by consumer 6.6 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

7 Producer-Consumer New Shared Buffer with counter Producer process while (true) /* produce an item and put in nextproduced */ while (count == BUFFER_SIZE) ; // do nothing buffer [in] = nextproduced; in = (in + 1) % BUFFER_SIZE; counter++; Consumer process while (true) while (count == 0) ; // do nothing nextconsumed = buffer[out]; out = (out + 1) % BUFFER_SIZE; counter--; /* consume the item in nextconsumed Allow full buffer, BUFFER_SIZE items in the buffer of BUFFER_SIZE Modified Producer Consumer define BUFFER_SIZE 10 typedef struct... item; item buffer[buffer_size]; int in = 0; int out = 0; int counter = 0; 6.7 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

8 Bounded Buffer The statements counter++; counter--; must be performed atomically ( 원자적으로연산되어야한다.) 원자연산은외부의인터럽트없이온전히실행되는연산을의미한다. (Atomic operation means an operation that completes in its entirety without interruption) 6.8 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

9 Race Condition( 경합상태 ) 경합상태 (race condition) : 두개의프로세스가경쟁적으로한변수를조작 두프로세스가공유변수 count(shared memory) 의변경명령이동시에수행될경우불일치발생 생산자의 count ++ register1 = count; register1 = register1 + 1; count = register1; 소비자의 counter -- register2 = count; register2 = register2-1; count = register2; 병행실행 (concurrent execution) T0: 생산자 register1 := count register1 = 5 T1: 생산자 register1 : = register1 + 1 register1 = 6 T2: 소비자 register2 := count register2 = 5 T3: 소비자 register2 := register2-1 register2 = 4 T4: 생산자 count := register1 counter = 6 T5: 소비자 count := register2 counter = 4 한 process 만접근하게해야함 6.9 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

10 An Example- Withdraw money from a bank account 은행계좌인출문제 (Withdraw money from a bank account) 잔고 100 만원을가진은행계좌를두친구가공유하고있다고가정한다. (Suppose you and your girl(boy) friend share a bank account with a balance of 1,000,000won) 두친구가 ATM 에가서동시에 10 만원을인출하려고할때어떤문제가발생할수있을까? (What happens if both go to separate ATM machines, and simultaneously withdraw 100,000won from the account?) int withdraw (account, amount) balance = get_balance (account); balance = balance - amount; put_balance (account, balance); return balance; 6.10 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

11 An Example (Cont d) Interleaved schedules 인출을위한별개의쓰레드가생성되고 (Represent the situation by creating a separate thread for each person to do the withdrawals) ( 선점스케듈링시 ) 두쓰레드의실행은중복될수있다. (The execution of the two threads can be interleaved, assuming preemptive scheduling) 6.11 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

12 Solution to Critical-Section Problem( 임계구역문제 ) 임계구역이란? 프로세스들이공유자료를접근하여변경하는코드의영역 상호배타적 (mutually exclusive) 으로실행되어야한다. 프로세스구조 진입구역 (entry section) : 진입허가요청 ( 한프로세스만실행 ) 출구구역 (exit section) 잔류구역 (remainder section) 임계구역문제해결을위한 3 요구조건 (requirements) R1. 상호배제 (mutual exclusion): 한프로세스만임계구역진입 R2. 진행 (progress): 자연스럽게막힘이없이진행, 임계구역에진입할프로세스선택이영원히지연되지않음 R3. 한계대기 (bounded waiting): 한프로세스가임계구역진입요청후기다리는데한계가있음 (no starvation) 기본기계명령어 (load, store, test) 원자적으로실행됨 (executed atomically) 6.12 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

13 Solution to Critical-Section Problem 임계구역 G 문제의해결을위한전형적인프로세스의일반적인구조 (General structure for a typical process Pi) do entry section exit section critical section remainder section while (TRUE); 6.13 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

14 Mechanisms for Critical Sections Locks Very primitive, minimal semantics, used to build others Semaphores Basic, easy to get the hang of, hard to program with Monitors High-level, requires language support, implicit operations Easy to program with: Java synchronized Messages Simple model of communication and synchronization based on (atomic) transfer of data across a channel Direct application to distributed systems 6.14 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

15 Locks Lock 의두개연산. (A lock is an object (in memory) that provides the following two operations) acquire() : lock 가해제될때까지기다린후해제되면잡는다 (wait until lock is free, then grab it) release(): 해제, 대기중인한쓰레드를활성화한다 (unlock, and wake up any thread waiting in acquire) Lock 의사용법 초기에 free 이다.(Lock is initially free) 임계구역진입전에 acquire() 를호출하고, 벗어날때 release() 를호출한다. (Call acquire() before entering a critical section, and release() after leaving it) acquire() and release() 사이에쓰레드는 lock 을잡고있다. (Between acquire() and release(), the thread holds the lock) 한호출자가 lock 를잡고있으면 acquire() 함수는반환되지않는다. (acquire() does not return until the caller holds the lock) 한순간최대한개의쓰레드가 lock 를잡고있다. (At most one thread can hold a lock at a time) Locks can spin (a spinlock) or block (a mutex) A mutex is an object in a program that serves as a lock and used to negotiate mutual exclusion among threads / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

16 Using Locks / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

17 Locks 의문제점 class Program static public bool lock1 = false; static void Main(string[] args) Console.WriteLine("Is Mutual Exclisive?"); Console.WriteLine("Test1 : "); Thread T1 = new Thread(new ThreadStart(Method)); Thread T2 = new Thread(new ThreadStart(Method)); Thread T3= new Thread(new ThreadStart(Method)); T1.Start(); T2.Start(); T3.Start(); T1.Join(); T2.Join(); T3.Join(); static void acquire(ref bool lock1) while (lock1) ; lock1 = true; static void release(ref bool lock1) lock1 = false;; Console.WriteLine("Test2 : "); T1 = new Thread(new ThreadStart(Method1)); T2 = new Thread(new ThreadStart(Method1)); T3 = new Thread(new ThreadStart(Method1)); T1.Start(); T2.Start(); T3.Start(); T1.Join(); T2.Join(); T3.Join(); static void Method() acquire(ref lock1); Console.WriteLine("0 ", Thread.CurrentThread.ManagedThreadId); Console.WriteLine("0 ", Thread.CurrentThread.ManagedThreadId); release(ref lock1); static void Method1() acquire(ref lock1); Console.WriteLine("0 ", Thread.CurrentThread.ManagedThreadId); Thread.Sleep(100); Console.WriteLine("0 ", Thread.CurrentThread.ManagedThreadId); release(ref lock1); 6.17 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

18 Implementing Locks (Cont d) Problem Lock의구현시역시임계문제를가지고있다.(Implementation of locks has a critical section, too!) acquire/release 는원자적이어야한다.(The acquire/release must be atomic) 원자적연산 (Atomic operation) 인터럽트되지않는연산 (Executes as though it could not be interrupted) 전부실행되든지전혀실행되지말아야하는연산 (Code that executes all or nothing ) Solutions Software-only algorithms Peterson s Solution for two processes Bakery algorithm for more than two processes Hardware atomic instructions Mutual Exclusion solution Test-and-set compare-and-swap, etc. Bounded Mutual Exclusion solution Test-and-set Disable/re-enable interrupts To prevent context switches 6.18 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

19 Initial Attempts to Solve Problem Only 2 processes, P0 and P1 General structure of process Pi (other process Pj) do entry section critical section exit section remainder section while (1); Processes may share some common variables to synchronize their actions Entry section Acquire a lock Exit section Release a lock 6.19 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

20 Peterson s Solution(software) 2개프로세스의 S/W 임계구역문제해법 LOAD 와 STORE 명령은원자적 (atomic) 즉, 수행도중절대인터럽트되지않음 2개프로세스가아래 2개변수공유 : int turn; Boolean flag[2] 변수 turn 은어느임계구역진입순번표시 The flag 배열은임계구역진입준비됨표시 flag[i] = true 는 process P i 가준비되었음! 6.20 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

21 Algorithm for Process P i in Peterson s solution The structure of process Pi do flag[i] = TRUE; turn = j; //trigger Pj while (flag[j] && turn == j); critical section flag[i] = FALSE; remainder section while (TRUE); The structure of process Pj do flag[j] = TRUE; turn = i; //trigger Pi while (flag[i] && turn == i); flag[j] = FALSE; while (TRUE); critical section remainder section Pi enter CS only when frag[j]==false or turn==i 동시시도시 frag[i]==frag[j]==true => turn 값배타적, 상대방 trigger 6.21 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

22 Bakery Algorithm Critical section for n processes(n 개프로세스에대한임계구역문제 ) Before entering its critical section, process receives a number. Holder of the smallest number enters the critical section If processes Pi and Pj receive the same number, if i < j, then Pi is served first; else Pj is served first The numbering scheme always generates numbers in increasing order of enumeration; i.e., 1,2,3,3,3,3,4,5... 최소번호수령 작은번호를받은프로세스가먼저실행한다 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

23 Bakery Algorithm Notation < lexicographical order (ticket #, process id #) (a,b) < (c,d) if a < c or if a = c and b < d max (a 0,, a n-1 ) is a number, k, such that k >= a i for i = 0,, n 1 Shared data boolean choosing[process]; // 우선순위받는기간의미 int priority[process]; // process : process id # Data structures are initialized to false and 0 respectively 6.23 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

24 Bakery Algorithm Shared Varialbes boolean choosing[p]; // 우선순위받기위한대기상태 int priority[p]; // p : process id initially choosing[..]=false; prioty[..]=0; do choosing[p] = true; // 프로세스 p 가우선순위받는모드진입 priority [p] = max(priority[0], priority[1],, priority[n 1])+1; choosing[p] = false; // // 프로세스 p 가우선순위받는모드종료 for (j = 0; j < n; j++) while (choosing[j]) ; // 우선순위받는중이면대기 while ((priority[j]!= 0) && ((priority[j],j)< (priority[p], p))) ; critical section priority[p] = 0; remainder section while (1); // 다른프로세스가우선하면그프로세스의처리까지대기 6.24 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

25 Synchronization Hardware 임계구역문제를해결하기위하여하드웨어 ( 명령 ) 가있다 (Many systems provide hardware (instruction) support for critical section code) 인터럽트무력화 현실행코드는선점되지않는다. 다른분제를야기 스케줄링등등 원자적하드웨어명령 최근의프로세서들의지원하고있다. Atomic = non-interruptable 예 TestAndSet(a) : test memory word and set value Swap(a,b) : swap contents of two memory words 6.25 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

26 Mutual Exclusion solution using TestAndSet TestAndSet 윈자명령을이용한상호배제알고리즘 (Mutual Exclusion using TestAndSet (hardware) instruction) 공유변수 : boolean lock., initialized to false. 프로세스 Pi 들은상호배제된다. initially lock =false; // global variable do while ( TestAndSet (&lock )) ; // critical section lock = FALSE; // remainder section while (TRUE); do while ( TestAndSet (&lock )) ; // critical section lock = FALSE; // remainder section while (TRUE); //hardware, Atomic instruction boolean TestAndSet (boolean *target) boolean rv = *target; *target = TRUE; return rv: 6.26 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

27 Mutual Exclusion Solution using Swap Instruction SWAP 명령을이용한상호배제알고리즘 (Mutual Exclusion Solution using Swap) 공유변수 : Boolean lock=false; 지역변수 : Boolean key 프로세스 Pi 들이상호배제된다. initially lock=false //shared do key = TRUE; //local variable while ( key == TRUE) Swap (&lock, &key ); // critical section lock = FALSE; // remainder section while (TRUE); do key = TRUE; //local variable while ( key == TRUE) Swap (&lock, &key ); // critical section lock = FALSE; // remainder section while (TRUE); void Swap (boolean *a, boolean *b) //hardware boolean temp = *a; *a = *b; *b = temp: 6.27 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

28 Bounded-waiting Mutual Exclusion with TestandSet() TestAndSet 명령을이용한유한대기상호배제알고리즘 프로세스 Pi 들이상호배제된다. do waiting[i] = TRUE; key = TRUE; while (waiting[i] && key) key = TestAndSet(&lock); waiting[i] = FALSE; // critical section //proceed when waiting[i]==false or key(lock)=false j = (i + 1) % n; while ((j!= i) &&!waiting[j]) // 대기중인다음프로세스를활성화한다. j = (j + 1) % n; // Bounded waiting 보장 if (j == i) else lock = FALSE; // lock= false로하여다른프로세스에게허용 waiting[j] = FALSE; // lock==true 인상태에서 Pj에서 while문장을지나 critical // remainder section while (TRUE); //section 진입하게한다 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

29 세마포어 (Semaphore concept) Semaphore is 일종의동기화도구이다. A kind of general synchronization tool Also is able to be used as a synchronization tool that does not require busy waiting Semaphore( 신호기 ) S : 원자적함수 wait() 과 signal() 로접근되는정수변수 S originally called P() and V(), (P from Duch proberen, to test. V from verhogen, to increment ) wait (S) //atomic operation S:semaphor variable while (S <= 0) ; // S>0 때까지대기 S--; signal (S) //atomic operation S++; 6.29 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

30 Usage of Semaphor Two types of semaphore Counting semaphore 무제한정수처리, N 개의자원관리공유시 Binary semaphore 정수 0,1,mutex locks An example of Binary semaphore Process p with mutual exclusion using semaphore mutex. Semaphore mutex=1; // initialized to 1 Shared data do wait (mutex); // 1->0 or 다른프로세스가 1로설정할때까지 busy waiting // Critical Section signal (mutex); // 0->1 // remainder section while (TRUE); An example of Counting semaphore N 개의공유자원을이용하기위한상호배제 Semaphore res=n ; // 공유자원수 : N do Wait(res) //res 자원이용하기전 N==0이면모든자원이사용중 // Critical Section Signal(res) //res++ 자원이용후 // remainder section while(true); 6.30 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

31 Usage of Semaphor Two types of semaphore Counting semaphore 무제한정수처리, N 개의자원관리공유시 Binary semaphore 정수 0,1,mutex locks An example of Binary semaphore Process p with mutual exclusion using semaphore mutex. Semaphore mutex=1; // initialized to 1 Shared data do wait (mutex); // 1->0 or 다른프로세스가 1로설정할때까지 busy waiting // Critical Section signal (mutex); // 0->1 wait(s) // remainder section while (TRUE); while(s<=0); S--; signal(s) S++; Semaphore mutex Process1 Process2 process wc s w c s w c s 6.31 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

32 Usage of Semaphor Two types of semaphore Counting semaphore 무제한정수처리, N 개의자원관리공유시 Binary semaphore 정수 0,1,mutex locks An example of Counting semaphore N 개의공유자원을이용하기위한상호배제 Semaphore res=n ; // 공유자원수 : N do Wait(res) //res 자원이용하기전 N==0이면모든자원이사용중 // Critical Section Signal(res) // remainder section while(true); //res++ 자원이용후 wait(s) while(s<=0); S--; signal(s) S++; Semaphore res Process1 Process2 process wc s wc s w c s 6.32 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

33 Semaphore Implementation with no Busy waiting 기본개념 Wait 연산의대기를무한반복대신에대기큐에서수행되도록하여시스템의효율을증가시킨다. Semaphore 구조 typedef struct int value; // struct process *L; //pointer to next record in the list semaphore; Two operations: block 프로세스를대기큐에추가하고일시중지 suspends the process, place the process invoking the operation on the appropriate waiting queue. wakeup 대기중인큐의포세스한개를분리하여 ready 큐에삽입하여실행을재개한다. resumes the execution of a blocked process, remove one of processes in the waiting queue and place it in the ready queue / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

34 Semaphore Implementation with no Busy waiting (Cont.) Implementation of wait: wait(semaphore *S) S->value--; //value는대기중인 process의수이다. if (S->value < 0) add this process to S->list; //add itself onto waiting list block(); // 자신의프로세스는대기큐로이동 / 실행중지 // value=0 : 자신은계속진행 Implementation of signal: signal(semaphore *S) S->value++; if (S->value <= 0) remove a process P from S->list; wakeup(p); // OS scheduler 의 ready queue로이동시킨다. //value >=1 : 다른프로세스의실행을허용 6.34 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

35 Deadlock and Starvation Deadlock 예 둘또는그이상의프로세스들이대기중인프로세스중하나가발생시킬이벤트를무한정기다리고있는상태 (two or more processes are waiting indefinitely for an event(signal()) that can be caused by only one of the waiting processes) 두개의프로세스 P1,P2 가두세마포 S,Q 가 1 인상태에서다음과같이대기중일때발생한다. (Let S and Q be two semaphores initialized to 1 where two processes P1,P2) P 0 P 1 wait (S); wait (Q); wait (Q); Starvation wait (S);.... signal (S); signal (S); signal (Q); signal (Q); indefinite blocking. A process may never be removed from the semaphore queue in which it is suspended. (P0,P1 모두세마포대기큐에추가된상태면영원히재실행이불가하다.) 6.35 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

36 6.6 Classical Problems of Synchronization 동기화문제의대표적사례 Bounded-Buffer Problem Readers and Writers Problem scheduling Dining-Philosophers Problem deadlock 6.36 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

37 Synchronization with critical problem initially in=out=counter=0 Bounded Buffer Problem / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

38 Bounded Buffer Problem (Cont d) Implementation with semaphores / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

39 C# Implementation with semaphores using C# language Mutex mutex = new Mutex() Semaphore empty = new Semaphore(N,N): Semaphore full =new Semaphore(0,N): void Produceer while (true) T t = Produce(); empty.waitone(); //empty mutex.waitone(); //mutex Append(t); mutex.releasemutex(); //mutex++ full.release(); //full++ void Consumer while (true) full.waitone(); //full mutex.waitone(); //mutex T t = Take(); mutex.releasemutex(); //mutex++ empty.release(); //empty-- Consume(t); / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

40 Semaphore 와 mutex 를이용한생산자 - 소비자문제 (C#) using System.Text; using System.Threading; abstract class ProCon<T> public ProCon(int maxbuffersize) this.maxbuffersize = maxbuffersize; mutex = new Mutex(); full = new Semaphore(0, maxbuffersize); empty = new Semaphore(maxBufferSize, maxbuffersize); public void Producer() public void Consumer() abstract public T Take(); abstract public void Append(T t); abstract public T Produce(); abstract public void Consume(T t); class MyProCon : ProCon<string> protected List<string> list; public MyProCon(int maxsize) : base(maxsize) list = new List<string>(maxSize); override public T Take() override public void Append(T t) override public T Produce() override public void Consume(T t) class Program public static void Main(string[] args) MyProCon m = new MyProCon(4); Thread pro = new Thread(m.Producer); pro.start(); // Thread pro2 = new Thread(m.Producer); //pro2.start(); Thread con = new Thread(m.Consumer); con.start(); Thread.Sleep(10000); //10 초정지 pro.suspend(); con.suspend(); //pro.join(); //con.join(); 6.40 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

41 abstract class ProCon<T> protected readonly int maxbuffersize; protected Mutex mutex; protected Semaphore full; protected Semaphore empty; public ProCon(int maxbuffersize) this.maxbuffersize = maxbuffersize; mutex = new Mutex(); full = new Semaphore(0, maxbuffersize); empty = new Semaphore(maxBufferSize, maxbuffersize); public void Producer() while (true) T t = Produce(); empty.waitone(); //empty-- mutex.waitone(); //mutex-- Append(t); mutex.releasemutex(); //mutex++ full.release(); //full++ public void Consumer() while (true) full.waitone(); //full-- mutex.waitone(); //mutex-- T t = Take(); mutex.releasemutex(); //mutex++ empty.release(); //empty++ Consume(t); //codes of critical section abstract public T Take(); abstract public void Append(T t); //non critical section abstract public T Produce(); abstract public void Consume(T t); class MyProCon : ProCon<string> protected List<string> list; public MyProCon(int maxsize) : base(maxsize) list = new List<string>(maxSize); // 데이터추가 ( 저장 ) //critical codes override public void Append(string t) list.add(t); string s = ""; foreach (string a in list) s += a + " "; Console.WriteLine("0,2 Append List:[1] 2", Thread.CurrentThread.ManagedThreadId,list.Count,s); // 데이터소비 //critical codes : override public string Take() string t = list[0]; list.removeat(0); string s=""; foreach (string a in list) s += a + " "; Console.WriteLine("0,2 Take List:[1] 2 item:3", Thread.CurrentThread.ManagedThreadId,list.Count,s,t); return t; // 데이터생성 override public string Produce() Random r = new Random(); int i = r.next(10); Console.WriteLine("0,2 Produce Item:1", Thread.CurrentThread.ManagedThreadId,i); return i.tostring(); // 데이터처리 override public void Consume(string t) Console.WriteLine("0,2 Consume Item:1", Thread.CurrentThread.ManagedThreadId, t); 6.41 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

42 실행결과분석 void Main() MyProCon m = new MyProCon(4); Thread pro = new Thread(m.Producer); Thread con = new Thread(m.Consumer); pro.start(); con.start(); Thread.Sleep(10000); //10 초정지 pro.suspend(); con.suspend(); Producer (thread no=3) while (true) 1 T t = Produce(); 2 empty.waitone(); //empty-- 3 mutex.waitone(); //mutex-- 4 Append(t); 5 mutex.releasemutex(); //mutex++ 6 full.release(); //full++ Consumer (thread no=4) while (true) 1 full.waitone(); //full 2 mutex.waitone(); //mutex 3 T t = Take(); 4 mutex.releasemutex(); //mutex++ 5 empty.release(); //empty++ 6 Consume(t); 6.42 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

43 Readers-Writers Problem 복수의 reader 및 writer 프로세스들이데이터집합을공유하는문제 Readers : 읽기전용, 복수의프로세스읽기가능, 수정불가능 Writers : 읽고쓰기가능, writer 프로세스들끼리배타적공유 Algorithm Shared Data, initially - Semaphore mutex =1 //readcount 갱신시상호배제용 - Semaphore wrt = 1 //writer 상호배제 - Integer readcount =0 // reading process 의수 The structure of a writer process do wait (wrt) ; //writing is performed //wrt=0 signal (wrt) ; //wrt=1 while (TRUE); The structure of a reader process do wait (mutex) ; //mutex=0 readcount ++ ; if (readcount == 1) wait (wrt); // 첫번째 reading 시부터 signal (mutex) // 읽는동안 write 금지 // reading is performed, // 복수프로세스가동시읽기가능 wait (mutex) ; readcount - - ; if (readcount == 0) signal (wrt) ; // 모두읽으면쓰기허용 signal (mutex) ; //mutex=1 while (TRUE); 6.43 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

44 Dining-Philosophers Problem Dining philosopher problem Dijkstra, 1965 Life of a philosopher: Repeat forever Thinking Getting hungry Getting two chopsticks Eating The structure of Philosopher i: Shared Data Semaphor chopstick [5] initialized to 1 philosohphor pi do wait ( chopstick[i] ); wait ( chopstick[ (i + 1) % 5] ); // eat signal ( chopstick[i] ); signal (chopstick[ (i + 1) % 5] ); // think while (TRUE); Correct use of semaphore operations: signal (mutex). wait (mutex) wait (mutex) wait (mutex) Omitting of wait (mutex) or signal (mutex) (or both) 6.44 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

45 Monitors 개념 프로세스에서세마포변수를잘못사용하면다양한문제가발생된다. 이런문제를해결하기위하여세마포변수및프로시듀어를구조체 (struct) 안에정의하고추상화하고프로그래머는이프로시쥬어를사용하여세마포변수를제어하므로서프로그램머의오류를줄일수있다. Monitor 는멤버를을캡슐화는 software module 이다. 소프트웨어모듈 ( 구조체, 클래스 ) 이다. 공유데이터구조들과공유데이터구조에서실행되는프로시듀어들을캡슐화한다. 이들프로시듀어를호출하는동시실행중인프로세스간의동기화 한번에하나의프로세스만인활성화된다. 추상화된데이터타입의안전한공유 General Structure of Monitor monitor monitor-name shared variable declarations procedure P1 ( ). procedure Pn ( ) Initialization code (.) 6.45 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

46 개요 Shared Data In Process i Monitor Solution to Dining Philosophers 좌우의이웃철학자가젓가락을얻을수있을때만잡도록강제한다. 양쪽의철학자가식사를하지않을때만식사한다. Monitor DP DP.Initialization(); while(1) for all i in process Pi think(); DP.pickup (i); eat(); DP.putdown (i); monitor DP enum THINKING; HUNGRY, EATING) state [5] ; condition self [5]; void pickup (int i) // state[i] = HUNGRY; // 상태를 hungry 로 test(i); // 죄우상태점검에따라서식사모드설정 if (state[i]!= EATING) self [i].wait(); // 식사모드로못들어갔으면대기상태로 void putdown (int i) state[i] = THINKING; // test left and right neighbors test((i + 4) % 5); test((i + 1) % 5); void test (int i) // 사색모드로 if ( (state[(i + 4) % 5]!= EATING) && (state[i] == HUNGRY) && // 우를점검하여식사대기중이었으면활성화 // 좌를점검하여식사대기중이었으면활성화 (state[(i + 1) % 5]!= EATING) ) // 좌우철학자가식사중이아니고내가배고프면 state[i] = EATING ; self[i].signal () ; // 내상태를식사모드로설정 // 대기중이었으면자신을활성화 void initialization() // 모든프로세스의상태를생각모드로 for (int i = 0; i < 5; i++) state[i] = THINKING; 6.46 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

47 Monitors Condition variable 모니터의멤버개체 ( 일종의 struct) condition x, y; 프로세스들이모니터내에서대기할수있는수단 condition 개체의멤버 operations wait and signal x.wait(); 프로세스가호출, suspended 상태진입 x.signal(); one suspended process 를재개시킨다. 만일 suspended 프로세스가없으면무시된다 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

48 Monitor with Condition Variables waiting queue of processes trying to enter the monitor at most one process in monitor at a time 6.48 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

49 An example of a Monitor to Allocate Single Resource 하나의자원을할당해주는모니터 monitor ResourceAllocator boolean busy; condition x; void acquire(int time) if (busy) x.wait(time); //time 과함께저장큐에 busy = TRUE; void release() busy = FALSE; x.signal(); initialization code() busy = FALSE; 프로세스에서자원접근하는방법 R.acquire(t) 자원접근 R.release() t: 자원접근요청시간 6.49 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

50 Synchronization Examples Solaris Windows XP Linux Pthreads 6.50 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

51 Solaris Synchronization Implements a variety of locks to support multitasking, multithreading (including real-time threads), and multiprocessing Uses adaptive mutexes for efficiency when protecting data from short code segments Uses condition variables and readers-writers locks when longer sections of code need access to data Uses turnstiles to order the list of threads waiting to acquire either an adaptive mutex or reader-writer lock 6.51 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

52 Windows XP Synchronization Uses interrupt masks to protect access to global resources on uniprocessor systems Uses spinlocks(kind of busy waiting locks) on multiprocessor systems Also provides dispatcher objects which may act as either mutexes and semaphores Dispatcher objects include timer objects, event objects, semaphore objects, mutex objects, and thread objects Dispatcher objects may also provide events. An event acts much like a condition variable 6.52 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

53 Linux Synchronization Linux: Prior to kernel Version 2.6, disables interrupts to implement short critical sections Version 2.6 and later, fully preemptive Linux provides: semaphores spin locks 6.53 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

54 Pthreads Synchronization Pthreads API is OS-independent It provides: mutex locks condition variables Non-portable extensions include: read-write locks spin locks 6.54 / 57 Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

55 End of Chapter 6, Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010

10주차.key

10주차.key 10, Process synchronization (concurrently) ( ) => critical section ( ) / =>, A, B / Race condition int counter; Process A { counter++; } Process B { counter ;.. } counter++ register1 = counter register1

More information

Module 7: Process Synchronization

Module 7:  Process Synchronization Chapter 6: Process Synchronization ( 프로세스동기화 ), Hanbat National Univ. Computer Eng. Dept. Y.J.Kim 2010 Module 6: Synchronization( 동기화 ) Background( 배경 ) The Critical-Section Problem( 임계구역문제 ) Peterson

More information

Microsoft PowerPoint - o6.pptx

Microsoft PowerPoint - o6.pptx 목표 6 장. 프로세스동기화 임계구역 (Critical Region) 문제소개 이문제에대한해결책은공유데이터의일관성유지에사용가능 임계구역문제의하드웨어및소프트웨어해결책제시 전통적인프로세스동기화문제소개 프로세스동기화문제해결에사용되는도구조사 2 6.1 배경 생산자 - 소비자문제 공유데이터사용 협력프로세스 (Cooperating process) 다른프로세스의실행을영향을주거나받는프로세스

More information

Microsoft PowerPoint - o6.pptx

Microsoft PowerPoint - o6.pptx Dining-Philosophers Problem 세마포사용 6.8 모니터 (Monitors) Semaphore chopstick[5] = {1,1,1,1,1 ; // initially all values are 1 Philosopher i while (true) { P(chopStick[i]); // get left chopstick P(chopStick[(i+1)

More information

Microsoft PowerPoint - o6.pptx

Microsoft PowerPoint - o6.pptx Dining-Philosophers Problem 세마포사용 Semaphore chopstick[5] = {1,1,1,1,1} ; // initially all values are 1 Philosopher i while (true) { P(chopStick[i]); // get left chopstick P(chopStick[(i+1) % 5]); // get

More information

untitled

untitled Embedded System Lab. II Embedded System Lab. II 2 RTOS Hard Real-Time vs Soft Real-Time RTOS Real-Time, Real-Time RTOS General purpose system OS H/W RTOS H/W task Hard Real-Time Real-Time System, Hard

More information

6주차.key

6주차.key 6, Process concept A program in execution Program code PCB (process control block) Program counter, registers, etc. Stack Heap Data section => global variable Process in memory Process state New Running

More information

Synchronization

Synchronization Synchronization Command Execution 명령어수행과운영체제 UNIX: 프로그램이실행한프로세스가종료될때까지대기 Windows: 실행된모든프로세스는각자수행 Enter Loop Enter Loop Yes Another Command? No fork()code Exit Loop Yes Another Command? No Exit Loop CreateProcess()code

More information

Microsoft PowerPoint - StallingsOS6e-Chap05.pptx

Microsoft PowerPoint - StallingsOS6e-Chap05.pptx 5 장병행성 : 상호배제와동기화 5 장의강의목표 병행성 (concurrency) 의원리와주요용어를이해한다. 경쟁상태 (race condition) 의문제점에대해이해한다. 상호배제 (mutual exclusion), 교착상태 (deadlock), 기아상태 (starvation) 의 3 가지제어문제를이해한다. 상호배제를보장하기위한하드웨어적접근방법을이해한다. 세마포어를이용한상호배제기법을이해한다.

More information

Chap06(Interprocess Communication).PDF

Chap06(Interprocess Communication).PDF Interprocess Communication 2002 2 Hyun-Ju Park Introduction (interprocess communication; IPC) IPC data transfer sharing data event notification resource sharing process control Interprocess Communication

More information

chap 5: Trees

chap 5: Trees 5. Threaded Binary Tree 기본개념 n 개의노드를갖는이진트리에는 2n 개의링크가존재 2n 개의링크중에 n + 1 개의링크값은 null Null 링크를다른노드에대한포인터로대체 Threads Thread 의이용 ptr left_child = NULL 일경우, ptr left_child 를 ptr 의 inorder predecessor 를가리키도록변경

More information

untitled

untitled - -, (insert) (delete) - - (insert) (delete) (top ) - - (insert) (rear) (delete) (front) A A B top A B C top push(a) push(b) push(c) A B top pop() top A B D push(d) top #define MAX_STACK_SIZE 100 int

More information

제11장 프로세스와 쓰레드

제11장 프로세스와 쓰레드 제9장자바쓰레드 9.1 Thread 기초 (1/5) 프로그램 명령어들의연속 (a sequence of instruction) 프로세스 / Thread 실행중인프로그램 (program in execution) 프로세스생성과실행을위한함수들 자바 Thread 2 9.1 Thread 기초 (2/5) 프로세스단위작업의문제점 프로세스생성시오버헤드 컨텍스트스위치오버헤드

More information

Abstract View of System Components

Abstract View of System Components 운영체제실습 - Synchronization - Real-Time Computing and Communications Lab. Hanyang University jtlim@rtcc.hanyang.ac.kr dhchoi@rtcc.hanyang.ac.kr beespjh@gmail.com Introduction 조교소개 이름 : 임정택 Tel : 010-4780

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 4 (Object) (Class) (Instance) (Method) (Constructor) Memory 1 UML 1 @ & 1 (Real World) (Software World) @ &.. () () @ & 2 (Real World) (Software World) OOA/ Modeling Abstraction Instantiation

More information

Page 2 of 6 Here are the rules for conjugating Whether (or not) and If when using a Descriptive Verb. The only difference here from Action Verbs is wh

Page 2 of 6 Here are the rules for conjugating Whether (or not) and If when using a Descriptive Verb. The only difference here from Action Verbs is wh Page 1 of 6 Learn Korean Ep. 13: Whether (or not) and If Let s go over how to say Whether and If. An example in English would be I don t know whether he ll be there, or I don t know if he ll be there.

More information

입학사정관제도

입학사정관제도 운영체제 강의노트 교재 : 운영체제 ( 개정판 ) 출판사 : 한빛미디어 (2010 년 11 월발행 ) 저자 : 구현회 소프트웨어학과원성현교수 1 4 장 병행프로세스와 상호배제 소프트웨어학과원성현교수 2 1. 병행프로세스 병행프로세스의과제 병행성 동시에 2 개이상의프로세스가실행되는성질 다중프로세싱시스템, 분산처리시스템에서주로발생 다중프로세싱시스템은프로세서의효율성을증대시킴

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 2... ( ). ( ). @ vs. logic data method variable behavior attribute method field Flow (Type), ( ) member @ () : C program Method A ( ) Method B ( ) Method C () program : Java, C++, C# data @ Program

More information

Page 2 of 5 아니다 means to not be, and is therefore the opposite of 이다. While English simply turns words like to be or to exist negative by adding not,

Page 2 of 5 아니다 means to not be, and is therefore the opposite of 이다. While English simply turns words like to be or to exist negative by adding not, Page 1 of 5 Learn Korean Ep. 4: To be and To exist Of course to be and to exist are different verbs, but they re often confused by beginning students when learning Korean. In English we sometimes use the

More information

쓰레드 (Thread) 양희재교수 / 경성대학교컴퓨터공학과

쓰레드 (Thread) 양희재교수 / 경성대학교컴퓨터공학과 쓰레드 (Thread) 양희재교수 (hjyang@ks.ac.kr) / 경성대학교컴퓨터공학과 Thread? 쓰레드 (Thread) 프로그램내부의흐름, 맥 class Test { public static void main(string[] args) { int n = 0; int m = 6; System.out.println(n+m); while (n < m) n++;

More information

Microsoft PowerPoint - StallingsOS6e-Chap06.ppt [호환 모드]

Microsoft PowerPoint - StallingsOS6e-Chap06.ppt [호환 모드] 6 장병행성 : 교착상태와기아 6 장의강의목표 교착상태 (deadlock) 의원리를이해한다. 교착상태에자원할당그래프가어떻게이용되는지이해한다. 교착상태가발생하기위한필요. 충분조건을이해한다. 교착상태예방기법들을이해한다. 교착상태회피기법들을이해한다. 교착상태의발견과복구기법들을이해한다. 식사하는철학자문제를이해하고해결방법을이해한다. UNIX, LINUX, Solaris,

More information

지능정보연구제 16 권제 1 호 2010 년 3 월 (pp.71~92),.,.,., Support Vector Machines,,., KOSPI200.,. * 지능정보연구제 16 권제 1 호 2010 년 3 월

지능정보연구제 16 권제 1 호 2010 년 3 월 (pp.71~92),.,.,., Support Vector Machines,,., KOSPI200.,. * 지능정보연구제 16 권제 1 호 2010 년 3 월 지능정보연구제 16 권제 1 호 2010 년 3 월 (pp.71~92),.,.,., Support Vector Machines,,., 2004 5 2009 12 KOSPI200.,. * 2009. 지능정보연구제 16 권제 1 호 2010 년 3 월 김선웅 안현철 社 1), 28 1, 2009, 4. 1. 지능정보연구제 16 권제 1 호 2010 년 3 월 Support

More information

- 2 -

- 2 - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 8 - - 9 - - 10 - - 11 - - 12 - - 13 - - 14 - - 15 - - 16 - - 17 - - 18 - - 19 - - 20 - - 21 - - 22 - - 23 - - 24 - - 25 - - 26 - - 27 - - 28 - - 29 - - 30 -

More information

Chap04(Signals and Sessions).PDF

Chap04(Signals and Sessions).PDF Signals and Session Management 2002 2 Hyun-Ju Park (Signal)? Introduction (1) mechanism events : asynchronous events - interrupt signal from users : synchronous events - exceptions (accessing an illegal

More information

Figure 5.01

Figure 5.01 Chapter 4: Threads Yoon-Joong Kim Hanbat National University, Computer Engineering Department Chapter 4: Multithreaded Programming Overview Multithreading Models Thread Libraries Threading Issues Operating

More information

Microsoft Word - FunctionCall

Microsoft Word - FunctionCall Function all Mechanism /* Simple Program */ #define get_int() IN KEYOARD #define put_int(val) LD A val \ OUT MONITOR int add_two(int a, int b) { int tmp; tmp = a+b; return tmp; } local auto variable stack

More information

<32382DC3BBB0A2C0E5BED6C0DA2E687770>

<32382DC3BBB0A2C0E5BED6C0DA2E687770> 논문접수일 : 2014.12.20 심사일 : 2015.01.06 게재확정일 : 2015.01.27 청각 장애자들을 위한 보급형 휴대폰 액세서리 디자인 프로토타입 개발 Development Prototype of Low-end Mobile Phone Accessory Design for Hearing-impaired Person 주저자 : 윤수인 서경대학교 예술대학

More information

Chapter #01 Subject

Chapter #01  Subject Device Driver March 24, 2004 Kim, ki-hyeon 목차 1. 인터럽트처리복습 1. 인터럽트복습 입력검출방법 인터럽트방식, 폴링 (polling) 방식 인터럽트서비스등록함수 ( 커널에등록 ) int request_irq(unsigned int irq, void(*handler)(int,void*,struct pt_regs*), unsigned

More information

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100 2015-1 프로그래밍언어 9. 연결형리스트, Stack, Queue 2015 년 5 월 4 일 교수김영탁 영남대학교공과대학정보통신공학과 (Tel : +82-53-810-2497; Fax : +82-53-810-4742 http://antl.yu.ac.kr/; E-mail : ytkim@yu.ac.kr) 연결리스트 (Linked List) 연결리스트연산 Stack

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Reasons for Poor Performance Programs 60% Design 20% System 2.5% Database 17.5% Source: ORACLE Performance Tuning 1 SMS TOOL DBA Monitoring TOOL Administration TOOL Performance Insight Backup SQL TUNING

More information

Interstage5 SOAP서비스 설정 가이드

Interstage5 SOAP서비스 설정 가이드 Interstage 5 Application Server ( Solaris ) SOAP Service Internet Sample Test SOAP Server Application SOAP Client Application CORBA/SOAP Server Gateway CORBA/SOAP Gateway Client INTERSTAGE SOAP Service

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 3 if, if else, if else if, switch case for, while, do while break, continue : System.in, args, JOptionPane for (,, ) @ vs. logic data method variable Data Data Flow (Type), ( ) @ Member field

More information

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for 2003 Development of the Software Generation Method using Model Driven Software Engineering Tool,,,,, Hoon-Seon Chang, Jae-Cheon Jung, Jae-Hack Kim Hee-Hwan Han, Do-Yeon Kim, Young-Woo Chang Wang Sik, Moon

More information

No Slide Title

No Slide Title Copyright, 2001 Multimedia Lab., CH 3. COM object (In-process server) Eun-sung Lee twoss@mmlab.net Multimedia Lab. Dept. of Electrical and Computer Eng. University of Seoul Seoul, Korea 0. Contents 1.

More information

Microsoft PowerPoint - 04-UDP Programming.ppt

Microsoft PowerPoint - 04-UDP Programming.ppt Chapter 4. UDP Dongwon Jeong djeong@kunsan.ac.kr http://ist.kunsan.ac.kr/ Dept. of Informatics & Statistics 목차 UDP 1 1 UDP 개념 자바 UDP 프로그램작성 클라이언트와서버모두 DatagramSocket 클래스로생성 상호간통신은 DatagramPacket 클래스를이용하여

More information

Mobile Service > IAP > Android SDK [ ] IAP SDK TOAST SDK. IAP SDK. Android Studio IDE Android SDK Version (API Level 10). Name Reference V

Mobile Service > IAP > Android SDK [ ] IAP SDK TOAST SDK. IAP SDK. Android Studio IDE Android SDK Version (API Level 10). Name Reference V Mobile Service > IAP > Android SDK IAP SDK TOAST SDK. IAP SDK. Android Studio IDE 2.3.3 Android SDK Version 2.3.3 (API Level 10). Name Reference Version License okhttp http://square.github.io/okhttp/ 1.5.4

More information

step 1-1

step 1-1 Written by Dr. In Ku Kim-Marshall STEP BY STEP Korean 1 through 15 Action Verbs Table of Contents Unit 1 The Korean Alphabet, hangeul Unit 2 Korean Sentences with 15 Action Verbs Introduction Review Exercises

More information

ESP1ºÎ-04

ESP1ºÎ-04 Chapter 04 4.1..,..,.,.,.,. RTOS(Real-Time Operating System)., RTOS.. VxWorks(www.windriver.com), psos(www.windriver.com), VRTX(www.mento. com), QNX(www.qnx.com), OSE(www.ose.com), Nucleus(www.atinudclus.

More information

쉽게 풀어쓴 C 프로그래밍

쉽게 풀어쓴 C 프로그래밍 Power Java 제 23 장스레드 이번장에서학습할내용 스레드의개요 스레드의생성과실행 스레드상태 스레드의스케줄링 스레드간의조정 스레드는동시에여러개의프로그램을실행하는효과를냅니다. 멀티태스킹 멀티태스킹 (muli-tasking) 는여러개의애플리케이션을동시에실행하여서컴퓨터시스템의성능을높이기위한기법 스레드란? 다중스레딩 (multi-threading) 은하나의프로그램이동시에여러가지작업을할수있도록하는것

More information

강의10

강의10 Computer Programming gdb and awk 12 th Lecture 김현철컴퓨터공학부서울대학교 순서 C Compiler and Linker 보충 Static vs Shared Libraries ( 계속 ) gdb awk Q&A Shared vs Static Libraries ( 계속 ) Advantage of Using Libraries Reduced

More information

1

1 1 1....6 1.1...6 2. Java Architecture...7 2.1 2SDK(Software Development Kit)...8 2.2 JRE(Java Runtime Environment)...9 2.3 (Java Virtual Machine, JVM)...10 2.4 JVM...11 2.5 (runtime)jvm...12 2.5.1 2.5.2

More information

<30322D28C6AF29C0CCB1E2B4EB35362D312E687770>

<30322D28C6AF29C0CCB1E2B4EB35362D312E687770> 한국학연구 56(2016.3.30), pp.33-63. 고려대학교 한국학연구소 세종시의 지역 정체성과 세종의 인문정신 * 1)이기대 ** 국문초록 세종시의 상황은 세종이 왕이 되면서 겪어야 했던 과정과 닮아 있다. 왕이 되리라 예상할 수 없었던 상황에서 세종은 왕이 되었고 어려움을 극복해 갔다. 세종시도 갑작스럽게 행정도시로 계획되었고 준비의 시간 또한 짧았지만,

More information

untitled

untitled Step Motor Device Driver Embedded System Lab. II Step Motor Step Motor Step Motor source Embedded System Lab. II 2 open loop, : : Pulse, 1 Pulse,, -, 1 +5%, step Step Motor (2),, Embedded System Lab. II

More information

11¹Ú´ö±Ô

11¹Ú´ö±Ô A Review on Promotion of Storytelling Local Cultures - 265 - 2-266 - 3-267 - 4-268 - 5-269 - 6 7-270 - 7-271 - 8-272 - 9-273 - 10-274 - 11-275 - 12-276 - 13-277 - 14-278 - 15-279 - 16 7-280 - 17-281 -

More information

<32B1B3BDC32E687770>

<32B1B3BDC32E687770> 008년도 상반기 제회 한 국 어 능 력 시 험 The th Test of Proficiency in Korean 일반 한국어(S-TOPIK 중급(Intermediate A 교시 이해 ( 듣기, 읽기 수험번호(Registration No. 이 름 (Name 한국어(Korean 영 어(English 유 의 사 항 Information. 시험 시작 지시가 있을

More information

Microsoft Word - ExecutionStack

Microsoft Word - ExecutionStack Lecture 15: LM code from high level language /* Simple Program */ external int get_int(); external void put_int(); int sum; clear_sum() { sum=0; int step=2; main() { register int i; static int count; clear_sum();

More information

비긴쿡-자바 00앞부속

비긴쿡-자바 00앞부속 IT COOKBOOK 14 Java P r e f a c e Stay HungryStay Foolish 3D 15 C 3 16 Stay HungryStay Foolish CEO 2005 L e c t u r e S c h e d u l e 1 14 PPT API C A b o u t T h i s B o o k IT CookBook for Beginner Chapter

More information

<31325FB1E8B0E6BCBA2E687770>

<31325FB1E8B0E6BCBA2E687770> 88 / 한국전산유체공학회지 제15권, 제1호, pp.88-94, 2010. 3 관내 유동 해석을 위한 웹기반 자바 프로그램 개발 김 경 성, 1 박 종 천 *2 DEVELOPMENT OF WEB-BASED JAVA PROGRAM FOR NUMERICAL ANALYSIS OF PIPE FLOW K.S. Kim 1 and J.C. Park *2 In general,

More information

김기남_ATDC2016_160620_[키노트].key

김기남_ATDC2016_160620_[키노트].key metatron Enterprise Big Data SKT Metatron/Big Data Big Data Big Data... metatron Ready to Enterprise Big Data Big Data Big Data Big Data?? Data Raw. CRM SCM MES TCO Data & Store & Processing Computational

More information

Something that can be seen, touched or otherwise sensed

Something that can be seen, touched or otherwise sensed Something that can be seen, touched or otherwise sensed Things about an object Weight Height Material Things an object does Pen writes Book stores words Water have Fresh water Rivers Oceans have

More information

본문01

본문01 Ⅱ 논술 지도의 방법과 실제 2. 읽기에서 논술까지 의 개발 배경 읽기에서 논술까지 자료집 개발의 본래 목적은 초 중 고교 학교 평가에서 서술형 평가 비중이 2005 학년도 30%, 2006학년도 40%, 2007학년도 50%로 확대 되고, 2008학년도부터 대학 입시에서 논술 비중이 커지면서 논술 교육은 학교가 책임진다. 는 풍토 조성으로 공교육의 신뢰성과

More information

thesis

thesis CORBA TMN Surveillance System DPNM Lab, GSIT, POSTECH Email: mnd@postech.ac.kr Contents Motivation & Goal Related Work CORBA TMN Surveillance System Implementation Conclusion & Future Work 2 Motivation

More information

Chapter 4. LISTS

Chapter 4. LISTS C 언어에서리스트구현 리스트의생성 struct node { int data; struct node *link; ; struct node *ptr = NULL; ptr = (struct node *) malloc(sizeof(struct node)); Self-referential structure NULL: defined in stdio.h(k&r C) or

More information

thesis

thesis ( Design and Implementation of a Generalized Management Information Repository Service for Network and System Management ) ssp@nile nile.postech.ac..ac.kr DPE Lab. 1997 12 16 GMIRS GMIRS GMIRS prototype

More information

UI TASK & KEY EVENT

UI TASK & KEY EVENT KEY EVENT & STATE 구현 2007. 1. 25 PLATFORM TEAM 정용학 차례 Key Event HS TASK UI TASK LONG KEY STATE 구현 소스코드및실행화면 질의응답및토의 2 KEY EVENT - HS TASK hs_task keypad_scan_keypad hs_init keypad_pass_key_code keypad_init

More information

The Self-Managing Database : Automatic Health Monitoring and Alerting

The Self-Managing Database : Automatic Health Monitoring and Alerting The Self-Managing Database : Automatic Health Monitoring and Alerting Agenda Oracle 10g Enterpirse Manager Oracle 10g 3 rd Party PL/SQL API Summary (Self-Managing Database) ? 6% 6% 12% 55% 6% Source: IOUG

More information

APOGEE Insight_KR_Base_3P11

APOGEE Insight_KR_Base_3P11 Technical Specification Sheet Document No. 149-332P25 September, 2010 Insight 3.11 Base Workstation 그림 1. Insight Base 메인메뉴 Insight Base Insight Insight Base, Insight Base Insight Base Insight Windows

More information

CompareAndSet(CAS) 함수는 address 주소의값이 oldvalue 인지비교해서같으면 newvalue 로 바꾼다. 소프트웨어 lock 을사용하는것이아니고, 하드웨어에서제공하는기능이므로더빠르고 간편하다. X86 에서는 _InterlockedCompareEx

CompareAndSet(CAS) 함수는 address 주소의값이 oldvalue 인지비교해서같으면 newvalue 로 바꾼다. 소프트웨어 lock 을사용하는것이아니고, 하드웨어에서제공하는기능이므로더빠르고 간편하다. X86 에서는 _InterlockedCompareEx NON-BLOCKING ALGORITHM Homepage: https://sites.google.com/site/doc4code/ Email: goldpotion@outlook.com 2011/10/23 멀티쓰레드환경에서알아두면유용한자료구조에대해소개해본다. HARDWARE PRIMITIVE 효율적인구현을위해, Hardware 에서제공하는기능을이용해야한다. 자주쓰는기능에대해

More information

HW5 Exercise 1 (60pts) M interpreter with a simple type system M. M. M.., M (simple type system). M, M. M., M.

HW5 Exercise 1 (60pts) M interpreter with a simple type system M. M. M.., M (simple type system). M, M. M., M. 오늘할것 5 6 HW5 Exercise 1 (60pts) M interpreter with a simple type system M. M. M.., M (simple type system). M, M. M., M. Review: 5-2 7 7 17 5 4 3 4 OR 0 2 1 2 ~20 ~40 ~60 ~80 ~100 M 언어 e ::= const constant

More information

K7VT2_QIG_v3

K7VT2_QIG_v3 1......... 2 3..\ 4 5 [R] : Enter Raid setup utility 6 Press[A]keytocreateRAID RAID Type: JBOD RAID 0 RAID 1: 2 7 " RAID 0 Auto Create Manual Create: 2 RAID 0 Block Size: 16K 32K

More information

#중등독해1-1단원(8~35)학

#중등독해1-1단원(8~35)학 Life Unit 1 Unit 2 Unit 3 Unit 4 Food Pets Camping Travel Unit 1 Food Before You Read Pre-reading Questions 1. Do you know what you should or shouldn t do at a traditional Chinese dinner? 2. Do you think

More information

2002년 2학기 자료구조

2002년 2학기 자료구조 자료구조 (Data Structures) Chapter 1 Basic Concepts Overview : Data (1) Data vs Information (2) Data Linear list( 선형리스트 ) - Sequential list : - Linked list : Nonlinear list( 비선형리스트 ) - Tree : - Graph : (3)

More information

λx.x (λz.λx.x z) (λx.x)(λz.(λx.x)z) (λz.(λx.x) z) Call-by Name. Normal Order. (λz.z)

λx.x (λz.λx.x z) (λx.x)(λz.(λx.x)z) (λz.(λx.x) z) Call-by Name. Normal Order. (λz.z) λx.x (λz.λx.x z) (λx.x)(λz.(λx.x)z) (λz.(λx.x) z) Call-by Name. Normal Order. (λz.z) Simple Type System - - 1+malloc(), {x:=1,y:=2}+2,... (stuck) { } { } ADD σ,m e 1 n 1,M σ,m e 1 σ,m e 2 n 2,M + e 2 n

More information

슬라이드 1

슬라이드 1 Pairwise Tool & Pairwise Test NuSRS 200511305 김성규 200511306 김성훈 200614164 김효석 200611124 유성배 200518036 곡진화 2 PICT Pairwise Tool - PICT Microsoft 의 Command-line 기반의 Free Software www.pairwise.org 에서다운로드후설치

More information

untitled

untitled Push... 2 Push... 4 Push... 5 Push... 13 Push... 15 1 FORCS Co., LTD A Leader of Enterprise e-business Solution Push (Daemon ), Push Push Observer. Push., Observer. Session. Thread Thread. Observer ID.

More information

Chapter 4. LISTS

Chapter 4. LISTS 6. 동치관계 (Equivalence Relations) 동치관계 reflexive, symmetric, transitive 성질을만족 "equal to"(=) 관계는동치관계임. x = x x = y 이면 y = x x = y 이고 y = z 이면 x = z 동치관계를이용하여집합 S 를 동치클래스 로분할 동일한클래스내의원소 x, y 에대해서는 x y 관계성립

More information

4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf("hihi\n"); } warning: conflicting types for functiona

4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf(hihi\n); } warning: conflicting types for functiona 이름 : 학번 : A. True or False: 각각항목마다 True 인지 False 인지적으세요. 1. (Python:) randint 함수를사용하려면, random 모듈을 import 해야한다. 2. (Python:) '' (single quote) 는한글자를표현할때, (double quote) 는문자열을표현할때사용한다. B. 다음에러를수정하는방법을적으세요.

More information

Chapter 4. LISTS

Chapter 4. LISTS 연결리스트의응용 류관희 충북대학교 1 체인연산 체인을역순으로만드는 (inverting) 연산 3 개의포인터를적절히이용하여제자리 (in place) 에서문제를해결 typedef struct listnode *listpointer; typedef struct listnode { char data; listpointer link; ; 2 체인연산 체인을역순으로만드는

More information

#Ȳ¿ë¼®

#Ȳ¿ë¼® http://www.kbc.go.kr/ A B yk u δ = 2u k 1 = yk u = 0. 659 2nu k = 1 k k 1 n yk k Abstract Web Repertoire and Concentration Rate : Analysing Web Traffic Data Yong - Suk Hwang (Research

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Team 1 201611293 전다윤 201311287 엄현식 201311318 최정헌 01. 문서수정 02. System Test Review 03. Static Test Review 04. 소감 1 문서수정 문서수정 수정 System Test 문서 + 전문서에없던수정사항 수정 System Test 문서 문서수정 소프트웨어검증팀의문서대로수정한사항들 1008

More information

03.Agile.key

03.Agile.key CSE4006 Software Engineering Agile Development Scott Uk-Jin Lee Division of Computer Science, College of Computing Hanyang University ERICA Campus 1 st Semester 2018 Background of Agile SW Development

More information

소프트웨어개발방법론

소프트웨어개발방법론 사용사례 (Use Case) Objectives 2 소개? (story) vs. 3 UC 와 UP 산출물과의관계 Sample UP Artifact Relationships Domain Model Business Modeling date... Sale 1 1..* Sales... LineItem... quantity Use-Case Model objects,

More information

04-다시_고속철도61~80p

04-다시_고속철도61~80p Approach for Value Improvement to Increase High-speed Railway Speed An effective way to develop a highly competitive system is to create a new market place that can create new values. Creating tools and

More information

0125_ 워크샵 발표자료_완성.key

0125_ 워크샵 발표자료_완성.key WordPress is a free and open-source content management system (CMS) based on PHP and MySQL. WordPress is installed on a web server, which either is part of an Internet hosting service or is a network host

More information

C# Programming Guide - Types

C# Programming Guide - Types C# Programming Guide - Types 최도경 lifeisforu@wemade.com 이문서는 MSDN 의 Types 를요약하고보충한것입니다. http://msdn.microsoft.com/enus/library/ms173104(v=vs.100).aspx Types, Variables, and Values C# 은 type 에민감한언어이다. 모든

More information

대한한의학원전학회지26권4호-교정본(1125).hwp

대한한의학원전학회지26권4호-교정본(1125).hwp http://www.wonjeon.org http://dx.doi.org/10.14369/skmc.2013.26.4.267 熱入血室證에 대한 小考 1 2 慶熙大學校大學校 韓醫學科大學 原典學敎室 韓醫學古典硏究所 白裕相1, 2 *117) A Study on the Pattern of 'Heat Entering The Blood Chamber' 1, Baik 1

More information

歯3이화진

歯3이화진 http://www.kbc.go.kr/ Abstract Terrestrial Broadcasters Strategies in the Age of Digital Broadcasting Wha-Jin Lee The purpose of this research is firstly to investigate the

More information

¹Ìµå¹Ì3Â÷Àμâ

¹Ìµå¹Ì3Â÷Àμâ MIDME LOGISTICS Trusted Solutions for 02 CEO MESSAGE MIDME LOGISTICS CO., LTD. 01 Ceo Message We, MIDME LOGISTICS CO., LTD. has established to create aduance logistics service. Try to give confidence to

More information

02 C h a p t e r Java

02 C h a p t e r Java 02 C h a p t e r Java Bioinformatics in J a va,, 2 1,,,, C++, Python, (Java),,, (http://wwwbiojavaorg),, 13, 3D GUI,,, (Java programming language) (Sun Microsystems) 1995 1990 (green project) TV 22 CHAPTER

More information

03장.스택.key

03장.스택.key ---------------- DATA STRUCTURES USING C ---------------- 03CHAPTER 1 ? (stack): (LIFO:Last-In First-Out) 2 : top : ( index -1 ),,, 3 : ( ) ( ) -> ->. ->.... 4 Stack ADT : (LIFO) : init():. is_empty():

More information

Let G = (V, E) be a connected, undirected graph with a real-valued weight function w defined on E. Let A be a set of E, possibly empty, that is includ

Let G = (V, E) be a connected, undirected graph with a real-valued weight function w defined on E. Let A be a set of E, possibly empty, that is includ 알고리즘설계와분석 (CSE3081(2 반 )) 기말고사 (2016년 12월15일 ( 목 ) 오전 9시40분 ~) 담당교수 : 서강대학교컴퓨터공학과임인성 < 주의 > 답안지에답을쓴후제출할것. 만약공간이부족하면답안지의뒷면을이용하고, 반드시답을쓰는칸에어느쪽의뒷면에답을기술하였는지명시할것. 연습지는수거하지않음. function MakeSet(x) { x.parent

More information

슬라이드 1

슬라이드 1 마이크로컨트롤러 2 (MicroController2) 2 강 ATmega128 의 external interrupt 이귀형교수님 학습목표 interrupt 란무엇인가? 기본개념을알아본다. interrupt 중에서가장사용하기쉬운 external interrupt 의사용방법을학습한다. 1. Interrupt 는왜필요할까? 함수동작을추가하여실행시키려면? //***

More information

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어 개나리 연구소 C 언어 노트 (tyback.egloos.com) 프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어먹고 하더라구요. 그래서,

More information

11장 포인터

11장 포인터 Dynamic Memory and Linked List 1 동적할당메모리의개념 프로그램이메모리를할당받는방법 정적 (static) 동적 (dynamic) 정적메모리할당 프로그램이시작되기전에미리정해진크기의메모리를할당받는것 메모리의크기는프로그램이시작하기전에결정 int i, j; int buffer[80]; char name[] = data structure"; 처음에결정된크기보다더큰입력이들어온다면처리하지못함

More information

11 템플릿적용 - Java Program Performance Tuning (김명호기술이사)

11 템플릿적용 - Java Program Performance Tuning (김명호기술이사) Java Program Performance Tuning ( ) n (Primes0) static List primes(int n) { List primes = new ArrayList(n); outer: for (int candidate = 2; n > 0; candidate++) { Iterator iter = primes.iterator(); while

More information

CD-RW_Advanced.PDF

CD-RW_Advanced.PDF HP CD-Writer Program User Guide - - Ver. 2.0 HP CD-RW Adaptec Easy CD Creator Copier, Direct CD. HP CD-RW,. Easy CD Creator 3.5C, Direct CD 3.0., HP. HP CD-RW TEAM ( 02-3270-0803 ) < > 1. CD...3 CD...5

More information

chap x: G입력

chap x: G입력 재귀알고리즘 (Recursive Algorithms) 재귀알고리즘의특징 문제자체가재귀적일경우적합 ( 예 : 피보나치수열 ) 이해하기가용이하나, 비효율적일수있음 재귀알고리즘을작성하는방법 재귀호출을종료하는경계조건을설정 각단계마다경계조건에접근하도록알고리즘의재귀호출 재귀알고리즘의두가지예 이진검색 순열 (Permutations) 1 장. 기본개념 (Page 19) 이진검색의재귀알고리즘

More information

untitled

untitled SAS Korea / Professional Service Division 2 3 Corporate Performance Management Definition ý... is a system that provides organizations with a method of measuring and aligning the organization strategy

More information

휠세미나3 ver0.4

휠세미나3 ver0.4 andromeda@sparcs:/$ ls -al dev/sda* brw-rw---- 1 root disk 8, 0 2014-06-09 18:43 dev/sda brw-rw---- 1 root disk 8, 1 2014-06-09 18:43 dev/sda1 brw-rw---- 1 root disk 8, 2 2014-06-09 18:43 dev/sda2 andromeda@sparcs:/$

More information

<3130C0E5>

<3130C0E5> Redundancy Adding extra bits for detecting or correcting errors at the destination Types of Errors Single-Bit Error Only one bit of a given data unit is changed Burst Error Two or more bits in the data

More information

歯15-ROMPLD.PDF

歯15-ROMPLD.PDF MSI & PLD MSI (Medium Scale Integrate Circuit) gate adder, subtractor, comparator, decoder, encoder, multiplexer, demultiplexer, ROM, PLA PLD (programmable logic device) fuse( ) array IC AND OR array sum

More information

歯1.PDF

歯1.PDF 200176 .,.,.,. 5... 1/2. /. / 2. . 293.33 (54.32%), 65.54(12.13%), / 53.80(9.96%), 25.60(4.74%), 5.22(0.97%). / 3 S (1997)14.59% (1971) 10%, (1977).5%~11.5%, (1986)

More information

PowerPoint Presentation

PowerPoint Presentation Class - Property Jo, Heeseung 목차 section 1 클래스의일반구조 section 2 클래스선언 section 3 객체의생성 section 4 멤버변수 4-1 객체변수 4-2 클래스변수 4-3 종단 (final) 변수 4-4 멤버변수접근방법 section 5 멤버변수접근한정자 5-1 public 5-2 private 5-3 한정자없음

More information

274 한국문화 73

274 한국문화 73 - 273 - 274 한국문화 73 17~18 세기통제영의방어체제와병력운영 275 276 한국문화 73 17~18 세기통제영의방어체제와병력운영 277 278 한국문화 73 17~18 세기통제영의방어체제와병력운영 279 280 한국문화 73 17~18 세기통제영의방어체제와병력운영 281 282 한국문화 73 17~18 세기통제영의방어체제와병력운영 283 284

More information

歯엑셀모델링

歯엑셀모델링 I II II III III I VBA Understanding Excel VBA - 'VB & VBA In a Nutshell' by Paul Lomax, October,1998 To enter code: Tools/Macro/visual basic editor At editor: Insert/Module Type code, then compile by:

More information

Oracle9i Real Application Clusters

Oracle9i Real Application Clusters Senior Sales Consultant Oracle Corporation Oracle9i Real Application Clusters Agenda? ? (interconnect) (clusterware) Oracle9i Real Application Clusters computing is a breakthrough technology. The ability

More information

<C7D1B9CEC1B7BEEEB9AEC7D03631C1FD28C3D6C1BE292E687770>

<C7D1B9CEC1B7BEEEB9AEC7D03631C1FD28C3D6C1BE292E687770> 설화에 나타난 사회구조와 그 의미 23) 박유미 * 차례 Ⅰ. 문제제기 Ⅱ. 서사 내부의 사회구조 Ⅲ. 사회문제의 해결방식과 그 의미 Ⅳ. 설화와 후대전승과의 상관관계 Ⅴ. 결론 국문초록 삼국유사 의 조에는 왕거인 이야기와 거타지 이야기가 하나의 설화에 묶여 전하고 있는데, 두 이야기는 해결구조에서 차이를

More information

RVC Robot Vaccum Cleaner

RVC Robot Vaccum Cleaner RVC Robot Vacuum 200810048 정재근 200811445 이성현 200811414 김연준 200812423 김준식 Statement of purpose Robot Vacuum (RVC) - An RVC automatically cleans and mops household surface. - It goes straight forward while

More information

13주-14주proc.PDF

13주-14주proc.PDF 12 : Pro*C/C++ 1 2 Embeded SQL 3 PRO *C 31 C/C++ PRO *C NOT! NOT AND && AND OR OR EQUAL == = SQL,,, Embeded SQL SQL 32 Pro*C C SQL Pro*C C, C Pro*C, C C 321, C char : char[n] : n int, short, long : float

More information

Microsoft PowerPoint - ch10 - 이진트리, AVL 트리, 트리 응용 pm0600

Microsoft PowerPoint - ch10 - 이진트리, AVL 트리, 트리 응용 pm0600 균형이진탐색트리 -VL Tree delson, Velskii, Landis에의해 1962년에제안됨 VL trees are balanced n VL Tree is a binary search tree such that for every internal node v of T, the heights of the children of v can differ by at

More information