Puas yog Ruby ib leeg threaded?
Puas yog Ruby ib leeg threaded?

Video: Puas yog Ruby ib leeg threaded?

Video: Puas yog Ruby ib leeg threaded?
Video: Tiam no hlub koj ib leeg xwb tus me siab zoo 2024, Hlis ntuj nqeg
Anonim

Cov lus teb luv luv yog yog, lawv yog ib threaded . Cov lus teb ntev yog nws nyob ntawm. JRuby yog multithreaded thiab tuaj yeem khiav hauv tomcat zoo li lwm yam java code. MRI (npe ruby ) thiab Python ob leeg muaj GIL (Global Interpreter Lock) thiab yog li ntawd ib threaded.

Hauv qhov no, puas yog Ruby ntawm Rails ib leeg threaded?

Vim li ntawd, txawm tias Rails nws tus kheej yog xov -kev nyab xeeb txij li version 2.2, tseem tsis tau muaj qhov zoo ntau- xov server rau nws ntawm Windows servers. Thiab koj tau txais txiaj ntsig zoo tshaj plaws los ntawm kev khiav ntawm * nix servers siv ntau txheej txheem / ib leeg - xov sib piv qauv. Rails raws li lub moj khaum yog xov - nyab xeeb. Yog li, cov lus teb yog yog!

Tom qab ntawd, lo lus nug yog, vim li cas Python yog ib leeg threaded? Qhov ntsuas phoo no tiv thaiv kev ua tiav ntawm ntau cov xov ib zaug hauv Python neeg txhais lus. Txhua xov uas xav khiav yuav tsum tos GIL tso rau lwm tus xov , uas txhais tau tias koj ntau threaded Python daim ntawv thov yog tiag tiag ib threaded.

Kuj nug, yog Ruby multi threaded?

A multithreaded program muaj ntau tshaj ib xov ntawm kev ua. Ruby ua kom yooj yim sau ntau - xov program nrog cov Xov chav kawm. Ruby threads yog ib txoj hauv kev yooj yim thiab muaj txiaj ntsig kom ua tiav qhov sib txuam hauv koj cov cai.

Puas yog Ruby muaj Gil?

Lub Ntiaj Teb Tus Txhais Lus Xauv MRI muaj Lub Ntiaj Teb Tus Txhais Lus Xauv, feem ntau hu ua GIL , thiab muaj kev nkag siab siab ntawm nws yog ib qho tseem ceeb rau kev nkag siab tias peb sau ntau txoj xov zoo li cas hauv Ruby . Yeej qhov GIL tiv thaiv ntau yam Ruby threads los ntawm kev ua haujlwm tib lub sijhawm.

Pom zoo: