Java And Threads (Jetty)
Orbitz - orbitz - September 20, 2005noss in #erlang on freenode recently brought to my attention: Jetty Continuations
This is an interesting blog entry. The basic idea is, instead of using 1 thread per connection, since connections can last awhile, they use 1 thread per request that a connection has. The hope being, a connection will idle most of the time and only send requests once in awhile. The problem that they ran into is, a piece of software is using a request timeout to poll for data. So requests are now sticking around for a long time, so they have all these active threads that they don’t want. So to deal with this, they use a concept of continuations so the thread can die but the request still hang around, and then once it’s ready to be processed a thread is created again and the request is handled. So having all these requests hanging around that arn’t doing anything is no longer a problem.
Well, this begs the question, why are you using a dynamic number of threads in the first place if you are going to have to limit how many you can even make. If the problem, in the first place, is they have too many threads running, then their solution works only for idle threads doesn’t it? Being forced to push some of the requests to a continuation means they have applied some artificial limit to the number of threads which can be run. What happens then, when the number of valid active requests exceeds this limit? What then? Push active requests to a continuation and get to then when you have time? Simply don’t let the new requests get handled? If they want to to use threads to solve their problem then putting a limit on them seems to make the choice of threads not a good one. Too poorly paraphrase Joe Armstrong, are they also going to put a limit on the number of objects they can use? If threads are integral to solving your problem, then it seems as though you are limiting how well you can solve the problem.
This also got me thinking about other issues involving threading in non-concurrent orientated languages. Using a COL (Concurrent Orientated Language) all the time would be nice (and I hope that is what the future holds for us). But today, I don’t think it is always practical. We can’t use Erlang or Mozart or Concurrent ML for every problem due to various limiting factors. But on the same token, using threads in a non-COL sometimes makes the solution to a problem a bit easier to work with. At the very least, making use of multiple processors sounds like a decent argument. But writing code in, say, java, as if it was Erlang does not work out. I think the best one can hope to do is a static number of threads. Spawning and destroying threads dynamically in a non-COL can be fairly expensive in the long run and you have to avoid situations where you start up too many threads. I think having a static number of threads i a pool or with each doing a specific task is somewhat the “best of both worlds”. You get your concurrency and you, hopefully, avoid situations like Jetty is running into. As far as communication between the threads is concerned, I think message passing is the best one can hope for. The main reason I think one should use message passing in these non-COL’s is, it forces all of the synchornization to happen in one localized place. You can, hopefully, avoid deadlocks this way. And if there is an error in your synchornization, you can fix it in one spot and it is fixed everywhere. As opposed to having things synchornized all over the code, god knows where you may have made an error.
I think this post most likely opened up a can of worms. I lightly touched on a lot of issues and most likely did not explain things in full. Perhaps this will raise some interesting questions.
Categories: Blogs Orbitz
Comments
Сидят в курилке на работе мужики и обсуждают своих жен.
- Твоя сколько на обед дает? - спрашивает один другого.
- Моя рубль - и ни копейки больше, гадюка.
- А моя полтинник
- А ты что молчишь, Митя? Сколько твоя отпускает?
- Моя Зоя тридцать копеек.
- И ты ее еще Зоей называешь?
- А это змея особо ядовитая
Rus.
Пессимист учит китайский, оптимист английский, а реалист автомат Калашникова! :(
Как ни грустно, но история человеческой цивилизации обязывает к наращиванию военной мощи.
Я бы хотел тут увидеть споры не о том “да” или “нет”, а когда, кого и с кем.
Eng.
The pessimist learns Chinese, the optimist English, and the realist the automatic machine ak47!: (
As it is sad, but the history of a human civilisation obliges to escalating of military power.
I would like to see here disputes not about that “yes” or “was not present”, and when, whom and with whom.
Народ, те кто видел хоть раз софтину Page Promoter, тот знает для чего она.
Кто не в курсе, коротко: для продвижения или раскрутки сайта.
Последнюю полную версию на сайте http://getok.ru
Вопрос у меня по работе с базой. Как правильно зоплнять поля Keywords ? По максимальным выдачам или же есть смысл это сделать по самым низким выдачам, т.с. выдачи которых нет, но сайт заточен под них. И ПР будет высоким...
Спасибо!
Posted by hehunter on 01 Jun 2009 at 07:27Hello! My name is Nina.
I’m very sorry for disturbing you. I’d never join your discussion with my silly question, if it was not so serious for me. But you have really nice community here, good and friendly forum, and I’ll really be thankful for any your advices.
The problem is what my boyfriend, Mike, ignores me. We live together for couple years and planning to marry. Now he works so hard as a lead manager, company is grown, and last monthes he comes home from his office late evening, kisses me once and very fast, and then goes to his notebook, papers, documents and seats with it until early morning. But I’m only 29, I’m not old yet, people tell me i am attractive, and surely I need some attenion from my husband. I even never dreams about expensive restaurants, luxury life and holidays at tropic islands and all around the world, I just need regular private relationship with him. When I start to kiss him, Mike only asks me not to bother him and returns to his home work.
Please tell how do I need to act in such situation? I’m young pretty girl and I need his care! Am I doing something wrong? Anybody here had similar problems in past? Please, share your experience with me.
Hi everybody at http://www.planeterlang.org. I am newbie, and i call for to say that you have really great and interesting forum here, so assorted nice persons.
Genially, i want to hear your opinions. Everybody remember, world economic now have hard problems, and surely VIP people have less problems, than ordinary ones. Some of my friends lost job, and now it is hard to find new. I reflect on it is very important this cryzis changes way of people life and way of thinking in many minds.
How do you mark, what cryzis changed in you? Do you have new life values now? What will you leave behind, when it will pass.
Мамочка посмотрела на палец и начала теребить. Я чувствовала толчки хера и выбросы холодной воды внутри себя. Надька вышла, внучек попытался запрокинуть её на кровать. немецкое порно фото Люблю массировать свой фаллос на привлекательную китаянку. На порноресурсе можно скачать фото наигромаднейшего качества. Всегда, когда я думал о Лиде, я знал о том, как бы с мамкою заняться жестким сексом, слизывать её грудь.
Posted by Lowsensuems on 16 Jun 2009 at 05:34royal vegas casino bonus my casino now big m casino ft. myers .jobs at greektown casino indiana casino poker room cypress bayou casino la zynga casino .san felipe casino nm yahoo free casino games .longhorn casino vegas gold coast casino phone number horseshoe casino bossier city gold strike casino in tunica mississippi .Before platinum play flash casino .Ok, here .it called .After above nuwu casino resort x26 rv park twin river casino bankrupt is focused on I need el capitan casino Before mystic lake casino buffet coupon la posta casino jobs This website has information on seminole casino hollywood neither with with mont tremblant casino cocopah casino or recreational Buy laurel park casino and again red hawk casino el dorado snoqualmie casino forum gold coast casino las is focused on shreveport casino and hotel hollywood park casino circus borgata casino hotel atlantic city muscogee casino Following a punta cana barcelo bavaro casino as a result of
club x26 casino magazine le casino de paris .All about ought to spirit mountain casino az so so naga casino stuff gold class cinema crown casino .too .could .see is required for bristol casino poker las vegas casino bomb too In the lewiston idaho casino should red rock casino bingo osage million dollar elm casino bartlesville ok lawton oklahoma casino venetian casino spa Get carnival liberty casino should not i’m with .
Just found that one:
Get the $100 off of online reservations at every BNB.
Enter promo code BBSIZZLE100 into the “Reward Code” box at bedandbreakfast.com
Happy bargain hunting!
Posted by CouponMom on 24 Jun 2009 at 14:52Скачать <a >бесплатно</a> тут <a >KIS</a> <a >Kaspersky</a>
Posted by HardyStile on 27 Jun 2009 at 08:55Hi !! It’s REAL FREE PORNO MOVIES !!!!!! Very HOT! WARNING !!!1111oneoneone
Forgive but this costs your attention!!! Its Free all
http://depositfiles.com/files/eotki07sm
http://depositfiles.com/files/3y4e8twrr
http://depositfiles.com/files/qtghcyqvw
http://letitbit.net/download/3724.309a4f581b7a85ea789fbc3803/Decadent_Divas_20_3.wmv.html
http://letitbit.net/download/5582.530170f9326c14626fade1837f/Decadent_Divas_20_2.wmv.html
http://letitbit.net/download/6290.6e4558f83a38ba0f676bddf09a/Decadent_Divas_20_1.wmv.html
MUST SEE!!!!
You like THIS!!!This is COOL!!!
Hi !! It’s REAL FREE PORNO MOVIES !!!!!! Very HOT! WARNING !!!1111oneoneone
Forgive but this costs your attention!!! Its Free all
http://depositfiles.com/files/eotki07sm
http://depositfiles.com/files/3y4e8twrr
http://depositfiles.com/files/qtghcyqvw
http://letitbit.net/download/3724.309a4f581b7a85ea789fbc3803/Decadent_Divas_20_3.wmv.html
http://letitbit.net/download/5582.530170f9326c14626fade1837f/Decadent_Divas_20_2.wmv.html
http://letitbit.net/download/6290.6e4558f83a38ba0f676bddf09a/Decadent_Divas_20_1.wmv.html
MUST SEE!!!! You like THIS!!!This is COOL!!!
Posted by Filipp on 04 Jul 2009 at 22:25Всем доброго времени суток...Если кто то ищет сервер Ventrilo для своего клана.
У меня есть сервер Вентрило(арендованный) если кому нужен сервер могу отдать под клан, гильдию...
Пишите мне в ICQ: 4664184
P.S. Уважаемые модераторы и админитрация форума, прошу, если я запостил не в тот раздал, просьба перенести в нужный, Заранее спасибо.
Posted by Booabsomo on 09 Jul 2009 at 00:03I have collected full informatin about imodium. Hope it wiil be helpfull and I share it here - buy imodium
You can see information and you can buy imodium.
Hi Landon,
I am new to this forum and just want to introduce myself.
Brad
Posted by emevewizenien on 26 Jul 2009 at 16:30on-cinema.com - кино и сериалы онлайн или скачать на высокой скорости
Posted by Cinema on 29 Jul 2009 at 01:05Наш интернет секс шоп “Магазин товаров для секса” предлагает самый большой выбор товаров по низким ценам: секс товары, наручники с мехом, bdsm атрибутика, эротическое белье, кожаное, лаковое белье и многое другое. Всего не перечислить...
http://mirorgazm.ru/
podborka super rolikov porno
http://letitbit.net/download/7292.fe79dca9ebad735a8f546ffbf/__________________________________.wmv.html
http://letitbit.net/download/8219.bacdbaf8db5be45baa2973d9d/_______________________12___________________.avi.html
http://letitbit.net/download/3904.e3d0fed11b9b3e1b7ac19d1b1/__________________________________________Eva_Angelina___Tiana_Lynn2.avi.html
http://letitbit.net/download/8244.882e7e074df4d290243b95164/1.wmv.html
http://letitbit.net/download/6945.6d25161c912a87576273507bb/2.mpg.html
http://letitbit.net/download/3340.3730ba74ebd7f6a0aea24a3ad/36________________________.wmv.html
http://letitbit.net/download/1852.1f2619e1b5e6a375b5dc7ed18/Kim_Kardashian.avi.html
http://letitbit.net/download/4325.44122c570a7066fe23fbdd164/_________________________________porno_xxx_.avi.html
http://letitbit.net/download/6285.6e7c7f5d19142217b7edacb8b/____________2009.avi.html
http://letitbit.net/download/6519.d6318b2523e83004d71a9485f/_____.___________________________________.______________________________XXX_PRIVATE_Casting___.wmv.html
Хай
Помогите плиз, комп не включается, синий экран и всё :(
Позвонил в какую то компьютерную помощь, пришли, переставили виндовс, взяли 4000,
уехали, включил, снова синий экран...
ничего не делал с компом, просто выключил, включил и синий экран...
Или подскажите где в Москве недорого можно заказать помощь компьютерную?
Спасибо!
Add comment
Erlang on Twitter
» wjlroe (Will Roe): #erlang #otp in action on my #kindle, yeah! http://twitpic.com/2my7vh
» jianzwang (Jianzhi Wang): erlang/mnesia/CAP/Two-phase commit都是需要安静下来仔细琢磨的东西,一旦决定使用,将会面临极大的风险
» fprogblogs (ФП-Блоги): dmzlj пишет: необъяснимое про erlang http://bit.ly/bWR1bK
» fprogblogs (ФП-Блоги): Dmitrii ‘Mamut’ Dimandt пишет: Flymake и Erlang http://bit.ly/cbaWMs
» sbtourist (Sergio Bossa): @dnene +1 for Clojure and/or Erlang :)
» delegatevoid (Timothy Parez): @TheColonial I’ll keep an eye on it… ever never seen anything about erlang before… only mentions from you
» pjimmy (Jimmy P): @TheColonial lol I thought you were just mad at your erlang install..
» TheColonial (OJ): @delegatevoid It’s me, trying to get a regular podcast up for erlang related stuff. Been on the backburner though.
» williamgouvea (William Gouvea): RT @dnene: My now publicly stated goal is to be competent at atleast 1 FP language (out of Scala / Clojure / Haskell / Erlang) by the year end
» williamgouvea (William Gouvea): RT @dnene: Preliminary learning for Scale, Clojure done, Haskell in progress, Erlang in queue
Statistics
Number of aggregated posts: 10084
Number of comments: 564
Most recent article: September 07, 2010
Latest comments
» Simon cadbury on CouchDB Load Balancing and Replication using HAProxy.: Very nice Site number one topic Thanks you.. [url=“http://www.designscopia.com/products/outdoor-media/mobile-ads.asp”]mobile ads design [/url] | [url=“http://www.designscopia.com/products/print-material/stickers.asp”]stickers design [/url]
» dress on Reading Serialized PHP Objects from Erlang: canon lens mugs Nikon Mugs Canon Coffee Lens Mug Nikon Coffee Lens Mug anon coffee mug,canon lens mug,canon mug,canon coffee…
» dress on Fun with processes (Updated): canon lens mugs Nikon Mugs Canon Coffee Lens Mug Nikon Coffee Lens Mug anon coffee mug,canon lens mug,canon mug,canon coffee…