yield함수 관련해서.. 제발 좀... 제발..

leolo의 이미지

솔라리스에 yield() 라는 함수를 리눅스에서 사용하고자 합니다.
sched_yield()라는 함수가 리눅스에 지원이 되는데
이것을 사용해도 될런지 알고 싶습니다.

또한, thr_self()함수 대신, pthread_self()를 사용해도 될런지.

제발 알려주세요..

leolo의 이미지

pthread_yield()랑 sched_yield()가 같은 역활을 하는 것으로 보이는 문서를
발견했습니다.
pthread_yield는 리눅스에서
sched_yield는 솔라리스에서

그럼, 솔라리스에서 사용하는 yield함수는
리눅스에서 무엇으로 사용하면 될까요?
man 하면 이렇게 나오네요..

솔라리스에서 man yield하면 나옴

System Calls yield(2)

NAME
yield - yield execution to another lightweight process

SYNOPSIS
#include <unistd.h>

void yield(void);

DESCRIPTION
The yield() function causes the current lightweight process
to yield its execution in favor of another lightweight pro-
cess with the same or greater priority.

SEE ALSO
thr_yield(3T)

SunOS 5.7 Last change: 20 Jul 1993

실력이 있으면 삶이 편하다... 영차 영차...