Dab tsi yog qhov txawv ntawm reentrant thiab thread safe functions?
Dab tsi yog qhov txawv ntawm reentrant thiab thread safe functions?

Video: Dab tsi yog qhov txawv ntawm reentrant thiab thread safe functions?

Video: Dab tsi yog qhov txawv ntawm reentrant thiab thread safe functions?
Video: Safekeeping Wisconsin: Water Quality, Hmong 2024, Hlis ntuj nqeg
Anonim

Xov zoo code yog ib qho uas tuaj yeem ua tau los ntawm ntau yam threads yam xyuam xim , txawm tias kev hu tshwm sim ib txhij ntawm ntau yam xov . Reentrant codemeans tias koj tuaj yeem ua txhua yam xov nyab xeeb code tuaj yeem dobut kuj lav kev nyab xeeb txawm koj hu tib yam muaj nuj nqi nyob rau hauv tib yam xov.

Tsis tas li ntawd, dab tsi yog qhov reentrant function?

A muaj nuj nqi yog reentrant yog tias nws tuaj yeem raug hu thaum twb nyob hauv tus txheej txheem ntawm kev ua tiav. Ntawd yog, a muaj nuj nqi yog reentrant yog tias nws tuaj yeem cuam tshuam hauv nruab nrab ntawm kev ua tiav (piv txwv li, los ntawm lub teeb liab lossis cuam tshuam) thiab rov hais dua ua ntej kev cuam tshuam kev ua tiav.

Ib sab saum toj no, QT xov puas nyab xeeb? Sau ntawv rau Qt Chav Kawm Ntau Qt cov chav kawm yog reentrant, tab sis lawv tsis tau ua xov - nyab xeeb , vim ua lawv xov - nyab xeeb yuav ua rau cov nyiaj siv ua haujlwm ntau dua ntawm kev kaw thiab qhib QMutex. Piv txwv li, QString isreentrant tab sis tsis xov - nyab xeeb . Ib txhia Qt classesand functions yog xov - nyab xeeb.

Yog li ntawd, dab tsi yog xov zoo ua haujlwm?

los ntawm wikipedia: Xov kev ruaj ntseg yog lub tswvyim computer programming siv tau rau hauv cov ntsiab lus ntawm multi- xov cov kev pab cuam. Hauv particular, nws yuav tsum txaus siab rau ntau yam xov kom nkag mus rau tib cov ntaub ntawv sib koom, thiab qhov xav tau ntawm cov ntaub ntawv sib koom kom nkag tau los ntawm ib qho xwb xov thaum twg los tau.

Dab tsi yog recursive functions?

Hauv cov ntsiab lus programming a recursive muaj nuj nqi tuaj yeem txhais tau raws li ib txwm ua uas hu nws tus kheej ncaj qha lossis ncaj qha.

Pom zoo: