Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
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
Archives
Today
Total
관리 메뉴

컴맹의 CS study

pthread sched_yield 본문

miscellaneous

pthread sched_yield

코코블라썸 2020. 6. 9. 14:53

when i want to make sure that one thing runs before another, like following

 

pid = fork()

if (pid) {
	// parent: yield to child so it can go
    sched_yield();
    printf("parent\n");
} else {
	printf("child\n");
}

 

reference

https://books.google.co.kr/books?id=4Kb_1sKprCMC&pg=PA171&lpg=PA171&dq=sched_yield+takes+most+of+running+time&source=bl&ots=vamCJ2CXFO&sig=ACfU3U2NOLMVVJCG7_Gz-YuYIYUbwquetA&hl=en&sa=X&ved=2ahUKEwiH9pLg9PPpAhUZa94KHQD3Dk8Q6AEwBHoECAkQAQ#v=onepage&q=sched_yield%20takes%20most%20of%20running%20time&f=false

 

'miscellaneous' 카테고리의 다른 글

filesystem type 확인 및 mount  (0) 2021.02.11
Vim folding  (0) 2020.07.06
Cmake 사용  (0) 2020.06.08
nvidia driver / cuda driver install  (0) 2020.06.05
윈도우/ubuntu 듀얼부팅시 grub이 작동하지 않을때  (0) 2020.06.05
Comments