|
̾??kse —
?桼???????åɤΤ????Υ????ͥ륵?ݡ???
?饤?֥???Standard C Library (libc, -lc)????<sys/types.h>
<sys/kse.h>
int
kse_create (struct kse_mailbox
*mbx, int newgroup) int
kse_exit (void)
int
kse_release (struct timespec
*timeout) int
kse_switchin (mcontext_t *mcp,
long val, long *loc)
int
kse_thr_interrupt (struct
kse_thr_mailbox *tmbx) int
kse_wakeup (struct kse_mailbox
*mbx)
???????????Υ????ƥॳ?????ϥޥ????????åɲ????줿?ץ??????Τ????? ?????ͥ륵?ݡ??Ȥ????????Ƥ??ޤ???????????Ū?˥桼???????åǥ??ϡ????? 2 ?Ĥ???ˡ?? 1 ?ĤǼ????????Ƥ??ޤ????? ???ƤΥ????åɤϥ桼?????֤Ǵ??????졢?????ͥ??????ƤΥ????åǥ??? ǧ?????ʤ???ˡ (“N ?? 1” ?Ȥ??Ƥ??Τ????Ƥ??ޤ?)?? ?ޤ??ϡ??ġ??Υ????åɤΤ????˶??̤Υ????????֤?ʬ???礦 ʬΥ?????ץ?????????????????ˡ (“N ?? N” ?Ȥ??Ƥ??Τ????Ƥ??ޤ?)?? ???????Υ??ץ???????Ĺ????û???????äƤ??ޤ?:
KSE ?????ƥ??ϥ桼???????åǥ??????ӥ????ͥ륹???åǥ???ξ???? Ĺ?????????뤲?뺮???Υ??ץ??????Ǥ??? KSE ?????ƥ??κ???Ū??ů?ؤϡ????????塼???????ꤹ?뤿???? ?桼???????åǥ??饤?֥?????ǽ?Ϥ????????????????Ȥʤ??? ?桼???????åǥ??Τ????Υ????ͥ륵?ݡ??Ȥ?Ϳ???뤳?ȤǤ??? ?????ͥ뤫???桼???????åɤؤ? upcall ?????ϡ????????塼???η??꤬ ɬ?פȤ??????Ȥ??ˤϤ??ĤǤ⡢?桼???????åǥ??饤?֥??????????? ?ܤ??????˻??Ѥ????ޤ??? Ǥ?դο??Υ桼???????åɤϡ??????ͥ??ˤ??äƶ??뤵???????????β??? CPU ???? ¿?Ų??????ޤ??? ?????? “N ?? M” ?????åǥ??????ȹͤ??뤳?Ȥ??Ǥ??ޤ??? ???Υ??ץ??????Τ????Ĥ??ΰ???Ū???ΰ?̣?ϰʲ????ޤߤޤ?:
????KSE ?ϥ桼???ץ????????ºݤ?Ʊ????ʣ???? ?????å? ?μ¹Ԥ???ǽ?ˤ??ޤ??? ???????δ??Ĥ??ϡ?????¾?Υ????åɤ??¹????ޤ??ϥ桼?????֤? ?֥å????????Ƥ????֤ˡ??????ͥ??????ǥ֥??å??????뤳?Ȥ???ǽ?Ǥ??? ?????ͥ륹?????塼???μ??? (kernel scheduling entity, KSE) ?ϥ????åɤμ¹ԤΤ????˥ץ??????˾??????줿 “???? CPU” ?Ǥ??? ???¹Ԥ????Ƥ??륹???åɤϾ??ˡ???̩?? 1 ?ĤΥ桼?????֤ޤ??? ?????ͥ???????ư??Ƥ????ɤ??餫?? KSE ?˴?Ϣ?դ??????Ƥ??ޤ??? ???? KSE ?Ϥ??Υ????åɤ? ???????Ƥ????Ƥ??? ?ȸ??????ޤ??????? KSE ????Ϣ?դ????줿 ????ܥå??? (????????) ?????äƤ??ơ????Υ????åɤ???Ϣ?դ????줿 ?????åɥ???ܥå??? (?????Ⲽ??????) ?????äƤ??ơ??????˰ʲ??Τɤ줫??ȯ???????Ȥ??ˡ????? KSE ?? ???????Ƥ????Ƥ??ʤ? ???֤ˤʤꡢ??Ϣ?դ????줿?????åɤ????ߤ????ޤ?:
???????????ȡ????????塼???η??꤬?Ԥ????ʤ????Фʤ??ʤ??ʤ??Ȥ????ˡ? ???? KSE ?ϳ??????Ƥ????Ƥ??ʤ????֤ˤʤ??ޤ??? ?ʤ??ʤ??С??????ͥ??Ϥ??Υץ???????¾?Τɤμ¹Բ?ǽ?ʥ????åɤ? ???????塼?뤹???٤????????ꤷ?ʤ??????Ǥ??? ???????Ƥ????Ƥ??ʤ? KSE ?Ͼ??˲?ǽ?ʸ¤???? ?桼???ץ??????????????Ѥ????٤? KSE ???ɤΤ褦?˷??ꤹ?뤫????ǽ?ˤ??? upcall ???? (?????˵??Ҥ????Ƥ??ޤ?) ???𤷤ƥ桼?????֤??????ޤ??? KSE ?Ͼ??ˡ????????Ƥ??????????????ˡ??????ͥ????Dz?ǽ?ʸ¤?¿???κ??Ȥ? ??λ?????ޤ??? KSE ???롼?? ?϶????˥??????塼?뤵?졢???? KSE ???롼?פ˴?Ϣ?դ????줿Ʊ???Υ????åɤ? ?ס????ؤΥ???????????ͭ???? KSE ?ν????Ǥ??? KSE ???롼?פϥ????ͥ륹?????塼????ͥ???٤????????Ƥ????뤳?Ȥ??Ǥ??? ?Ǿ??μ??ΤǤ??? ?ץ??????Υ??????塼???ȥ????????ƥ??Τ??ᡢ???줾???? KSE ???롼?פ? ????Ū?ʥ????åɲ??????Ƥ??ʤ??ץ???????Ʊ?ͤ˥??????Ȥ??ޤ??? KSE ???롼?פ????θġ??? KSE ?ϼºݾ塢??ʬ?????Ĥ??ޤ????? ?ޤ???KSE ???롼?פ????Τ??????? KSE ?ϡ????? KSE ???롼?פ? ??Ϣ?դ????줿 (?????ͥ?????) ?????????¹Բ?ǽ?ʥ????åɤˡ? ?????ͥ??ˤ??äƳ??????Ƥ????뤳?Ȥ??Ǥ??ޤ??? ?º??????Ȥ??ơ??????ͥ??ϥ????å?????ư??????Ŭ?????뤿???ˡ??????åɤ? ?ºݤ? CPU ?Ȥ?̩?ܤʴط?????¸???褦?Ȼ??ߤޤ????? ?????ϥ桼???ץ??????ˤ??ԲĻ??Ǥ??? (̩?ܤʴط??Ϥޤ??????????Ƥ??ޤ???) ???줾???? KSE ?ϥ桼???ץ??????ˤ??äƶ??뤵?줿ͣ???? KSE ????ܥå??? ?????äƤ??ޤ??? ????ܥå????? upcall ?ؿ? ?ؤΥݥ????ޤ????湽¤?Τȥ桼???????å??ǹ????????Ƥ??ޤ??? KSE ?ϳ??????Ƥ?????????????ɬ?????δؿ????¹Ԥ??ޤ??? ?????ͥ??Ϥ??ι?¤?Τ¹Բ?ǽ?ˤʤäƤ??륹???åɡ??????Ӥ??줾???? upcall ???????ۿ????줿?????ʥ??ˤĤ??Ƥξ????????ޤ??? upcall ?ϥ????ƥ????륻?????????δ֤ϡ??桼???????åɤ? ???????塼???????ɤˤ??äư???Ū?˥֥??å??????뤳?Ȥ??????ޤ??? Ʊ?ͤˤ??줾???Υ桼???????åɤ?ͣ???? ?????åɥ???ܥå??? ?????äƤ??ޤ??? ?????ͥ??ȥ桼???????åɥ??????塼?餬?̿??????Ȥ??ˡ? ?????åɤϤ??????Υ???ܥå????ؤΥݥ??????Ѥ??ƻ??Ȥ????ޤ??? ???줾???? KSE ?Υ???ܥå????ϡ????? KSE ?????¹Ԥ??Ƥ??? ?桼???????åɤΥ???ܥå????ؤΥݥ????ޤ??Ǥ??ޤ??? ???Υݥ??ϥ????ͥ????ǥ????åɤ??֥??å??????Ȥ??ˡ???¸?????ޤ??? ?????ͥ????ǥ֥??å??????Ƥ????????åɤ??桼?????֤????????????Ǥ????Ȥ??ˤ? ɬ???????Υ????åɤ? KSE ???롼?פ? ??λ???? ?????åɤΥꥹ?Ȥ??ɲä????ޤ??? ???Υꥹ?Ȥϥ????åɥ???ܥå????Υ????줿?ꥹ?ȤȤ??ơ? ???? upcall ?ǥ桼???????ɤ˸????????ޤ??? ?????ͥ???????Ʊ???˥֥??å??????뤳?Ȥ??Ǥ??? KSE ???롼?פ????? ?????åɿ??ˤϡ??????ͥ??˵??????????¤??????ޤ? (???ߡ????ο??ϥ桼???ˤ? ?ԲĻ??Ǥ?)?? ???????¤?ã?????Ȥ??ˤϡ??????åɤ? 1 ?Ĥ???λ?????ޤǤδ? (?ޤ??? ?????ʥ뤬?ۿ????????ޤǤδ?)??upcall ?ϥ֥??å????졢 ???? KSE ???롼?פΤ????κ??Ȥϲ????¹Ԥ????ޤ????? KSE ?δ????ޥ????????åɲ????뤿???ˤϡ??ץ??????Ͻ?????kse_create ()
???¹Ԥ??ʤ????Фʤ??ޤ?????
kse_create () ?????ƥॳ?????Ͽ?????
KSE ?? ???????ޤ?
(?????˺ǽ??μ¹Ԥ????????????Ȥ??Ƥ???????)??
???? KSE ?? mbx
?ˤ??äƻؤ?????????ܥå????ȴ?Ϣ?դ??????ޤ???
newgroup ?? 0
?ǤϤʤ??????ˤϡ????? KSE
???ޤ???? KSE ???롼?פ??????????ޤ???
?????Ǥʤ??????ˤϡ????ο????? KSE
?ϸ??ߤ? KSE ???롼?פ??ɲä????ޤ???
???????????????? KSE
?Ϻǽ??ϳ??????Ƥ????Ƥ??ޤ?????
???Τ??ᡢ???????? KSE ??ľ???? upcall ???ޤ???
???줾???Υץ??????Ͻ????? 1
?ĤΥ桼???????åɤ? ?¹Ԥ??? 1
?Ĥ? KSE ???롼?פ????? 1 ?Ĥ? KSE
?????äƤ??ޤ??? ???? KSE
?ϴ?Ϣ?դ????줿????ܥå????????äƤ??ʤ????ᡢ???Υ????åɤ?
???????Ƥ??줿?ޤޤǤʤ????Фʤ餺??upcall
???????¹Ԥ??ޤ?????
???η??̤?????Ū?ǡ??????åɲ??????Ƥ??ʤ??ͼ????????Ǥ???
???Τ??ᡢ???̤ʾ????Ȥ??ơ?
newgroup ?? 0
?ˤ??????κǽ??Υ????åɤˤ???
?????ͥ??? 1 ?Ĥ? KSE ???롼?פ????˥????ƥ???ʪ??Ū?? CPU ?ο? (???ο??? sysctl(3) ?ѿ??? hw.ncpu ?Ȥ??????Ѳ?ǽ?Ǥ?) ????¿?? KSE ??¸?ߤ????Ĥ??ޤ????? CPU ????¿?? KSE ?????Ĥ??Ȥϡ??????ɲä? KSE ??ñ?? ????¾?? KSE ?ȼ? CPU ?ؤΥ????????礹???????Ǥ??뤿?ᡢ ?桼???ץ??????ˤȤä????????ͤ????䤵?ʤ??Ǥ??礦?? ???Τ??ᡢ;ʬ?? KSE ?Ͼ????Ƥ??ɤ??????졢???η??̥??ץꥱ?????????? ?ޤ??ˤ??꾯?ʤ? KSE ?????äƤ??뤳?Ȥ?Ʊ???ˤʤ??Ǥ??礦?? ?ɤ??ʤ?¿????Ǥ?դΥ桼???????åɤ?¸?ߤ??뤳?ȤˤʤäƤ⡢ ???Ѳ?ǽ?? KSE ?ؤΥ??ץꥱ?????????Υ桼???????åɤγ??????Ƥ????갷?? ?????Υ桼???????åɥ??????塼?????Ϥ??ޤ???
???̤ʾ????Ȥ??ơ??Ǹ??˻ĤäƤ???
KSE
???롼?פ????κǸ??˻ĤäƤ???
KSE ??
???Υ????ƥॳ???????¹Ԥ????????ˤϡ?????
KSE ???˲??????ޤ????? ???????ˡ????? KSE
?Ϥ??Υ???ܥå????Ȥδ?Ϣ?դ????????ǡ?
?????ʥ????ߤμ????????̤Υ????ʥ륹???åɤ????????ޤ??? ?ץ????????Υ????ͥ륹???å? (KSE) ?Ϥ??٤ƤΥ????ʥ????ޥ??????? ?????ʥ륹???åɤ??????ץ????????ۿ??????륷???ʥ????Ԥ??ޤ??? ?????ʥ륹???åɤϥ桼???????åɤؤΥ????ʥ??? ?ǥ????ѥå????Ф?????Ǥ???????ޤ??????μ????ϡ?¿?ť????åɤ?
??ʬ???????????????̤??Ȥ߹??碌
KSE ????ܥå??????줾???? KSE ??<sys/kse.h>
?????????줿?桼???ȥ????ͥ????̿??Τ?????ͣ???Υ???ܥå??????????ޤ???
???Υե??????ɤΤ????Ĥ??ϼ????̤??Ǥ?:
km_version
?Ϥ??ι?¤?ΤΥС?????????ɽ????
km_func ?Ϥ??? KSE ?? upcall ?ؿ????ؤ??ޤ??? ?????ϡ????? KSE ??¸?ߤ??Ƥ????֤?ͭ???Ǥ???³???ʤ????Фʤ??ʤ? km_stack ?????Ѥ??Ƽ¹Ԥ????ޤ??? km_curthread
?Ͼ??ˡ??⤷?????и??ߤ??? KSE
?˳??????Ƥ????Ƥ??륹???åɤޤ???
?????Ǥʤ????? km_curthread ?? km_curthread ?? ???Ƥ? upcall ?????? km_completed ?ϺǶ??? upcall ?ʹߤ˥????ͥ????Ǥν????????桼???????åɤ? ?????줿?ꥹ?Ȥ??ؤ??Ƥ??ޤ??? ???Υ桼???????åɥ??????塼???ϡ????????Υ????åɤ? ???????塼?餬??ͭ?????¹Բ?ǽ???塼???᤹?٤??Ǥ??? upcall ?˵??夹?? (Ʊ???ޤ?????Ʊ????) ?????ͥ??????? ??λ???? KSE ???롼?????γơ??Υ????åɤϡ??μ¤? 1 ?Ĥ? KSE ?? km_completed ?˥??????뤳?Ȥ??ݾڤ????ޤ??? ???????ʤ??顢???Υ??롼?פ????Τɤ? KSE ?????????Ǥ??? ???ξ塢???δ?λ?Ϥ??ä? 1 ?Ĥ? upcall ?Ǥ??????𤵤??ޤ????? km_sigscaught ?Ϥ??????Υץ????????????Ƥ? KSE ?ؤ? upcall ?ʹߤˡ? ???Υץ??????ˤ??ä????ޤ????줿?????ʥ??Υꥹ?Ȥ??ޤޤ??Ƥ??ޤ??? ???Υ桼???ץ??????????ˡ? ????ܥå????˴?Ϣ?դ????줿 KSE ?? 1 ?İʾ?¸?ߤ????¤??ϡ? ?????ʥ???????Ū????ˡ?ǤϤʤ???????ˡ???ۿ??????ޤ??? (?????Ϥޤ??????????Ƥ??餺???ѹ??????뤫?⤷???ޤ???) km_timeofday ?ϡ????줾???? upcall ?????˥????ͥ??ˤ??äƸ??ߤΥ????ƥ??????????ꤵ???ޤ??? km_flags ?ϰʲ??????ƤΥӥå????? OR ???ޤळ?Ȥ??Ǥ??ޤ?:
?????åɥ???ܥå??????줾???Υ桼???????åɤϤ????˴?Ϣ?դ????줿<sys/kse.h>
?????????줿ͣ???? struct kse_thr_mailbox
???ʤ????Фʤ??ޤ?????
?????ϼ??Υե??????ɤ??ޤ??Ǥ??ޤ?:
tm_udata ?ϥ????ͥ??ˤ??ä?̵?뤵?줿?????Ƥʥݥ??Ǥ??? tm_context ?ϥ桼?????????ǥ????åɤ??֥??å????줿???ˡ????Υ????åɤΤ????? ?????ƥ????Ȥ???¸???ޤ??? ???Υե??????ɤϴ?λ?????????åɤ? km_completed ???𤷤ƥ桼???????åɥ??????塼???????????ˡ??????ͥ??ˤ??äƤ???????ޤ??? tm_next ?ϥ????ͥ??? upcall
?ˤ??????ä????ˡ? km_completed
?????åɤ˥????ޤ???
???Υꥹ?ȤκǸ??? tm_uticks ??????
tm_sticks
?Ϥ??줾?졢?桼???⡼?ɤ????ӥ????ͥ??⡼?ɤμ¹ԤΤ????λ??֥????Ǥ???
???????Υ????????ץ????å?
(clocks(7)
?Ȥ??Ƥ???????)
?ι??ߤ????Ȥ??ޤ???
?????ͥ????Ǥ????줫?Υ????åɤ??????ƥ??֤˼¹????δ֤ϡ??б?????
tm_sticks
???????????????Ȥ????ޤ???
?桼?????֤Ǥ????줫?? KSE ?¹????ǡ?????
KSE ?? km_curthread ?ݥ???
tm_flags ?ϰʲ??????ƤΥӥå????? OR ???ޤळ?Ȥ??Ǥ??ޤ?:
???????????ξ????ˤ?kse_create (),
kse_wakeup () ??????
kse_thr_interrupt () ?????ƥॳ?????? 0
???֤??ޤ??? ?????ξ????ˤ?
kse_exit () ??????
kse_release ()
?????ƥॳ???????????ޤ?????
???顼?ξ????ˤϡ??????????ƤΥ????ƥॳ?????? 0 ?ǤϤʤ? ???顼?????ɤ??֤??ޤ??? ???顼kse_create ()
?????ƥॳ?????ϼ??ξ????˼??Ԥ??ޤ?:
??Ϣ????rfork(2), pthread(3), ucontext(3) Thomas E. Anderson, Brian N. Bershad, Edward D. Lazowska, and Henry M. Levy, Scheduler activations: effective kernel support for the user-level management of parallelism, ACM Press, ACM Transactions on Computer Systems, Issue 1, Volume 10, pp. 53-79, February 1992.????KSE ?????ƥॳ???뷲?? FreeBSD 5.0 ?ǤϤ??????о줷?ޤ?????????KSE ?Ͻ????? Julian Elischer ⟨julian@FreeBSD.org⟩ ?????????? Jonathan Mini ⟨mini@FreeBSD.org⟩, Daniel Eischen ⟨deischen@FreeBSD.org⟩ ?????? David Xu ⟨davidxu@FreeBSD.org⟩ ???ɲäι??ޤ????????Υޥ˥奢???ڡ????? Archie Cobbs ⟨archie@FreeBSD.org⟩ ?ˤ??äƽ??ޤ????? ?Х?KSE ?Υ????ɤϳ?ȯ???Ǥ???
Visit the GSP FreeBSD Man Page Interface. |