11/03/2006

Ruby Thread

JavaEye 有一篇文章 Ruby的伪线程,講述的是 Ruby 在 Thread 的問題。在目前為止,Ruby 的 Thread 還不是 native thread ,所以根據 jack 的說法
这样做的确使得Ruby的Thread很容易控制,程序也不容易产生类似死锁这类严重的线程问题。但是效率始终无法提高,因为在ruby进程中,实际上只 有一个真实的线程在运行,同样的代码在那么多核或者多cpu的电脑上运行效率和单核cpu的电脑上的效率并不会相差多少。
當然 Thread 對於 Performance 對於效能的進步是有很大的幫助啦。不過目前 Ruby 上面最有希望的 Native Thread Virtual Machine :YARV 目前處於緩步狀態。(一個人作實在太操了)並且 YARV 到目前並沒有完整的計畫支援 continuation 的計畫,這實在對 Ruby 社群更加減少了使用 YARV 的動力。

根據 Another Year, Another Interpreter 這篇文章,更是拋下一個震撼彈
And then Matz and Koichi dropped the bomb: Ruby 2.0 would support neither continuations nor green threads.
真是太慘了,看來 Thread 在 Ruby 還是遙遙無期。這時候,Ruby 社群應該把重心投入在 YARV 上面,還是剛剛傳出大捷報的 JRuby 上面呢?畢竟 JRuby 是 Native Thread 的,目標也是可以在 JVM 上面跑 Ruby on Rails (目前 JRuby 確定可以跑 Active Record )。這似乎是一個好選擇,不過 Ruby 社群是不是願意將所有籌碼壓寶在 JRuby 呢?JRuby 現在可是由SUN 這家商業公司所主導的。

當然就算 Ruby 支援 Thread ,也會有很多問題要解決。Rails 本身不是 Thread Safe 的,Zed Shaw (Mongrel 作者)也說 Meta Programming 有很多 Thread Safe Probelm 。總之,Thread on Ruby 是一個難題,短期內也應該不會有很好的解法。

12 則留言:

contagion 提到...

其實我覺得 Ruby 慢的原因和 thread 沒有什麼太大的關係。之前在 railscn 也和別人吵過相關的問題,請參考我的這篇文章

thegiive 提到...

Con...這篇是好文章,其實我把 Thread 當成一種語言的基礎建設啦,有糟糕的地方就得講出來啦。不過是不是 Ruby 有許多特性不適合 Thread?還得看看。

匿名 提到...

computer home based business home based travel business http://uhas.eu/search-mobiles/saturn-of-mobile redseal travel [url=http://uhas.eu/search-mobiles/t-mobile-water-damage]t mobile water damage[/url]
rac travel guide http://uhas.eu/cell-phone-directory/genoa-city-wisconsin-post-office-phone-number formula one travel [url=http://uhas.eu/mobile/t-mobile-wing-cell-phone-detail]aaa travel in columbus ga[/url]
gi travel deals http://uhas.eu/search-mobiles/thanksgiving-day-car-crash-update-in-mobile-alabama dominican republic travel excellence [url=http://uhas.eu/cell-phone-reviews/match-a-phone-number-to-a-persons-address]match a phone number to a persons address[/url]
exuss travel http://uhas.eu/mobile-planet/mobile-home-skirting-blocks travel agency turin [url=http://uhas.eu/cell-phone-reviews/what-is-the-phone-number-and-email-adress-to-cantact-the-fcc]travel trailer tow vehicles[/url]
south floruda 16u travel team http://uhas.eu/cell-phone/compare-satellite-phone-wilderness travel from nz to raratonga [url=http://uhas.eu/mobile-planet/mobile-game-free]mobile game free[/url]
arca qr head travel tripod http://uhas.eu/mobile-planet/commander-mobile-antivirus-serial travel agencies in atlanta [url=http://uhas.eu/cell-phone/lg-env-phone-review]cheltenham travel inns[/url]

匿名 提到...

tvb tvd travel http://uhas.eu/cell-phone-reviews/how-do-i-receive-a-picture-message-on-my-verizon-phone travel boarding pass [url=http://uhas.eu/search-mobile/free-call-online-but-mobile-to-mobile]free call online but mobile to mobile[/url]
china land travel http://uhas.eu/mobile/windows-mobile-6-cannot-delete-files does light travel in a straight line [url=http://uhas.eu/mobiles/bella-vista-california-mobile-homes]international travel service[/url]
rosenbluth travel delaware http://uhas.eu/cell-phone/compare-satellite-phone-wilderness travel jewelry pouch [url=http://uhas.eu/mobile-planet/mobile-reciver-circuit]mobile reciver circuit[/url]
stormwind travel from ironforge http://uhas.eu/cell-phones/inside-phone-numbers slot car travel box [url=http://uhas.eu/mobile/map-for-route-a-knights-of-revolvers-downtown-mobile-alabama]insurance ski travel cheap business insurance[/url]
bike travel case http://uhas.eu/cell-phone-reviews/unlock-any-phone the warehouse travel insurance [url=http://uhas.eu/cell-phones/phone-number-outreach-disabled-veterans-help]phone number outreach disabled veterans help[/url]
heinlein time travel http://uhas.eu/cell-phones/cash-my-phone perfex long travel suspension kit [url=http://uhas.eu/mobile-planet/mobile-home-bathtub]harry potter travel tour[/url]

匿名 提到...

photograph of a pharmacy http://diabetes-type.kqv.in/information-on-symptoms-of-diabetes pharmacy christmas reading area [url=http://depression.kqv.in/employment-during-the-great-depression]employment during the great depression[/url]
advantages of online pharmacy http://penis-growth.kqv.in/erotic-glans-penis compounding pharmacy classifieds [url=http://orgasm.kqv.in/ftv-sasha-sticky-wet-orgasm]mcsweeney group sells pharmacy[/url]
university at buffalo pharmacy law review series may 23 http://heart-medicine.kqv.in/sacred-heart-memorial-hospital-diet fda guidelines pharmacy [url=http://drug-policy.kqv.in/urine-odor-drug-use]urine odor drug use[/url]
westby pharmacy http://pill.kqv.in/pill-g-22 best choices from the peoples pharmacy book [url=http://diet-and.kqv.in/new-life-style-diet]pharmacy technician jobs in south florida[/url]
cheapscripts pharmacy http://diet-online.kqv.in/heidi-klum-diet online pharmacy reviews [url=http://diabetes-type.kqv.in/renal-diabetes-diet-menu]renal diabetes diet menu[/url]
texas state board of pharmacy website http://dental.kqv.in/dental-implant-new-saratoga-york meridia pharmacy online sale [url=http://diet.kqv.in/bariatric-diet-food]preparation h with biodyne canadian pharmacy[/url]

匿名 提到...

bigblack ass http://porn-xxx.qgu.in/dial-up-porn-free free adult anime pix [url=http://blow.qgu.in/popeye-blow-me-down-wallpaper]popeye blow me down wallpaper[/url]
i love licking ass http://orgy.qgu.in/cum-orgy adult stocking stuffers for car lovers [url=http://virgins.qgu.in/preteen-tiny-virgins]arlingyon adult education[/url]
adult top halloween costume ideas http://virgins.qgu.in/virgins-first-time-porn adult book stores in manhattan [url=http://photo-sexual.qgu.in/stories-sexual]stories sexual[/url]
new adult websites http://hentai-sex.qgu.in/harry-potter-porn-hentai i need anal sex spanking [url=http://incest.qgu.in/free-incest-litritature]adult white masquerade costume gloves costume gloves[/url]
funny adult santa jokes http://blow.qgu.in/rushing-wind-blow-though-this-temple nc adult diretory [url=http://bondage.qgu.in/tv-bondage]tv bondage[/url]
adult hardcore sex movies and pics http://bondage.qgu.in/art-of-bondage anal mums [url=http://sex-mature.qgu.in/mature-dutch-erotica]amateur licking[/url]

匿名 提到...

auditing compnaies that travel http://airport.qrv.in/coast-airport-hotel-vancouver insurance ntuc singapore travel [url=http://flight.qrv.in/flight-tracker-international]flight tracker international[/url]
boat travel members british columbia http://tourism.qrv.in/arkansas-jobs-in-hospitality-tourism-stats heritage leather shoulder travel bag mens [url=http://vacation-packages.qrv.in/vacation-package-from-toronto-to-golden-nugget-in-las-vegas]four winds travel trailer[/url]
george stuart travel http://airline.qrv.in/airline-crash-pukhet guatemala travel deals [url=http://tourism.qrv.in/philippines-samar-tourism]philippines samar tourism[/url]
air travel to las vagas http://tourism.qrv.in/wales-tourism-information airborne travel link [url=http://travel.qrv.in/pennsylvania-travel-advisory]travel zines[/url]
stainless steel travel coffee mug http://airline.qrv.in/curtis-spokane-airline caribbean vacation travel cruise [url=http://plane-tickets.qrv.in/plane-tickets-for-under-100-dollars]plane tickets for under 100 dollars[/url]
boonton travel http://travel.qrv.in/par-o-dice-travel-chesterfield-michigan british travel western australia [url=http://adventure.qrv.in/mile-high-adventure-club]newborn travel systems[/url]

匿名 提到...

[url=http://naajgraj.pl]Gry online[/url]

匿名 提到...

beyonce award speech http://xmw.in/goldfrapp/download-oh-la-la-by-goldfrapp radiohead concert tickets 2008 [url=http://xmw.in/nirvana/nirvana-chocolatier]nirvana chocolatier[/url]
best beatles song http://xmw.in/frank-zappa/frank-zappa-movies what is written on elvis presley tombstone [url=http://xmw.in/pearl-jam/pearl-jam-myspace-images]free download mp3 christmas songs[/url]
hard rock casino florida http://xmw.in/nickelback/rock-star-by-nickelback dark blac forest mp3 [url=http://xmw.in/nirvana/nirvana-mollys-lips]nirvana mollys lips[/url]
maverick soundtrack http://xmw.in/janet-jackson/janet-jackson-escapde rilo kiley mp3 [url=http://xmw.in/ministry-sound/tease-ministry-of-sound]mp3 format versus ipod format[/url]
what vocal range is used for pop http://xmw.in/goldfrapp/tiptoe-by-goldfrapp lg vx8700 ringtones [url=http://xmw.in/lenny-kravitz/lenny-kravitz-poolside]lenny kravitz poolside[/url]
carters musical mobile http://xmw.in/metallica/metallica-my-world-bass-tab free pop up blocker 2007 [url=http://xmw.in/kylie-minogue/kylie-minogue-pussy]pop up cup puppet[/url]

匿名 提到...

how to make ringtones for http://dave-matthews.qev.in/dave-matthews-back-you-up ska desktop theme [url=http://thai-prince.qev.in/prince-of-tennis-lyrics]prince of tennis lyrics[/url]
keane audio mp3 http://dylan.qev.in/bob-dylan-dob poker game ww2 queen mary [url=http://cardigans.qev.in/orvis-cardigans]cell phone motorola cingular free ringtone really[/url]
memorial music http://carrie-underwood.qev.in/carrie-underwood-music-videos heartland country music [url=http://cardigans.qev.in/knitted-cardigans]knitted cardigans[/url]
green musical teddy bear http://adele.qev.in/adele-kamen olivia space halo mp3 [url=http://beatles.qev.in/the-beatles-all-my-loving-guitar-chord]ipod free porn[/url]
krasilovsky this business of music http://fleetwood.qev.in/fleetwood-mobile-homes-prices greater vision gospel group [url=http://cardigans.qev.in/live-and-learn-cardigans]live and learn cardigans[/url]
hip hop womens clothing http://adele.qev.in/adele-john-bourne body combat music cd [url=http://clash.qev.in/naruto-clash-of-ninja-2-oboro-mode]castles made of sand lyrics jimi hendrix[/url]

匿名 提到...

[url=http://www.WadeIndustries.com/article/Lost-and-Found-In-Adaptation-Fate-Stay-Night.html]Lost and Found In Adaptation Fate Stay Night[/url]
[url=http://www.WadeIndustries.com/article/Decorating-your-kids-rooms-with-colors.html]Decorating your kids rooms with colors[/url]
[url=http://www.WadeIndustries.com/article/Love-quiz-Do-You-Feel-Loved.html]Love quiz Do You Feel Loved[/url]
[url=http://www.WadeIndustries.com/article/Basic-Guide-To-Tanzanite.html]Basic Guide To Tanzanite[/url]
[url=http://www.WadeIndustries.com/article/Top-5-Financial-Freedom-Tips-For-Success.html]Top 5 Financial Freedom Tips For Success[/url]
[url=http://www.WadeIndustries.com/article/A-Simple-Way-to-Address-Common-Wireless-Network-Problems.html]A Simple Way to Address Common Wireless Network Problems[/url]
[url=http://www.WadeIndustries.com/article/Online-Pet-Stars-What-Makes-A-Great-Pet-Website.html]Online Pet Stars What Makes A Great Pet Website[/url]
[url=http://www.WadeIndustries.com/article/Doors-Open-2006-Toronto-s-Architectural-Festival-Sure-Has-Become-Popular.html]Doors Open 2006 Toronto s Architectural Festival Sure Has Become Popular[/url]
[url=http://www.WadeIndustries.com/article/5-Need-to-Know-Business-Bankruptcy-Tips.html]5 Need to Know Business Bankruptcy Tips[/url]
[url=http://www.WadeIndustries.com/article/Canadian-Bacon-Now-An-American-Favorite.html]Canadian Bacon Now An American Favorite[/url]

匿名 提到...

[url=http://www.WadeIndustries.com/article/Shopping-for-Christmas-Tree-Decorations.html]Shopping for Christmas Tree Decorations[/url]
[url=http://www.WadeIndustries.com/article/Pay-The-Right-Price-Laminate-Flooring.html]Pay The Right Price Laminate Flooring[/url]
[url=http://www.WadeIndustries.com/article/how-are-diamonds-mined-187.html]how are diamonds mined 187[/url]
[url=http://www.WadeIndustries.com/article/Tips-For-Seniors.html]Tips For Seniors[/url]
[url=http://www.WadeIndustries.com/article/Beautifully-Crafted-Sterling-Silver-Hearts-Feature-Half-Open-Design-and-Half-Dainty-Marcasite-Detail.html]Beautifully Crafted Sterling Silver Hearts Feature Half Open Design and Half Dainty Marcasite Detail[/url]
[url=http://www.WadeIndustries.com/article/A-perfect-cure-for-the-problem-called-Erectile-Dysfunction.html]A perfect cure for the problem called Erectile Dysfunction[/url]
[url=http://www.WadeIndustries.com/article/Handle-With-Care-How-to-Pack-For-Moving-Day.html]Handle With Care How to Pack For Moving Day[/url]
[url=http://www.WadeIndustries.com/article/Free-and-Entertaining-Escape-Games-for-the-Whole-Family.html]Free and Entertaining Escape Games for the Whole Family[/url]
[url=http://www.WadeIndustries.com/article/Pro-s-And-Con-s-Of-Low-Cost-And-No-Cost-Refinancing.html]Pro s And Con s Of Low Cost And No Cost Refinancing[/url]
[url=http://www.WadeIndustries.com/article/Menorca-Must-See-Attractions-While-on-Holiday-in-Menorca.html]Menorca Must See Attractions While on Holiday in Menorca[/url]