일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- 자물쇠와 열쇠
- level 2
- pwnable
- vscode
- 타겟 넘버
- github
- 베스트앨범
- 같은숫자는싫어
- 스택/큐
- level3
- 여행경로
- themida
- 코딩테스트
- Programmers
- DFS/BFS
- level1
- 전화번호 목록
- 문자열압축
- 머신러닝
- level 3
- 동적계획법
- 프로그래머스
- 동빈나
- Python3
- 더 맵게
- 선형회귀
- 개발
- level2
- 2020 KAKAO BLIND RECRUITMENT
Archives
- Today
- Total
hoon
fork(), sched_setaffinity() 그리고 성능 측정에 관하여.. 본문
fork()의 성공의 Retrun value는 parent는 child process pid를 반환받고 child는 0을 반환받는다.
(child process pid는 절대로 0이 아니다. 0은 단지 성공에 대한 return value이다.!!)
int sched_setaffinity(pid_t pid, size_t cpusetsize,const cpu_set_t *mask)는 cpu코어를 정할 수 있게 해주는 함수이다.
설명에 잘 나와있듯이 If pid is zero, then the calling thread is used.
NOTE
....
Specifying pid as 0 will set the attribute for the calling thread, and passing the value returned from a call to getpid(2) will set the attribute for the main thread of the thread group.
...
0이 아닌 다른값을 넣어주면 thread group의 주 thread에 대한 속성(부수물?)이 설정된다.
프로그램 성능 측정 시
너무너무 짧은 시간은 computer님이 제대로 파악을 할 수가 없다...
그래서 여러번 반복한 시간을 측정하여 나눠주는 것이다.(평균을 낸 다음에 정확성의 측면에도 있겠지만)
자료구조론에 초기에 나오는 내용이다..까먹지말자...
대충 코딩하지 말고 다시 한번 찾아보자...
'Operating Systems' 카테고리의 다른 글
Scheduling (0) | 2021.04.10 |
---|---|
Virtualization-process (0) | 2021.03.13 |
운영체제 개요 (0) | 2021.03.06 |
Comments