Ir ao conteúdo

Exercicio 1 – Sistemas Operacionais II – INE5424 – UFSC

Trabalho 1 – EPOS
Idle-waiting Thread Joining
– Este trabalho tinha como objetivo alterar o modo que era feito o “join” em uma Thread. Sendo que o mesmo inicialmente era feito da seguinte maneira:
[code lang=”c”] while(_state != FINISHING)
yield();
[/code]

O mesmo consiste basicamente, em verificar o estado da thread que se esta dando join e caso o estado nao seja FINISHING dar a vez a outro processo. Esta solucao, acarreta no consumo excessivo de recursos ja que o mesmo sempre retorna para a fila de _ready. E eh executado novamente quando o escalonador escolher esta thread. O trabalho pede que seja modificado de modo que o consumo de recursos nao seja excessivo.

Arquivos Modificados:
thread.cc
Thread.h

Solucao:
     Foi criada uma variável adicional em threads.h, _waiting_for_me, que é um ponteiro para uma thread. Quando o método “join” é chamado, a thread que está executando é colocada no _waiting_for_me da thread chamada e é suspensa. Se a thread já finalizou ou alguém já chamou “join” nela, nada é feito. No método “exit”, caso _waiting_for_me esteja preenchida, é chamado o método “resume” na thread referenciada.
     Pensamos em colocar uma lista de referências para várias threads poderem dar “join” na mesma thread, porém vimos na documentação do POSIX que isso era considerado um erro lógico, e achamos que acarretaria um consumo de recursos adicional desnecessário, pois não seria possível usar o _link já existente na thread, já que ela teria de estar tanto na lista de suspensos quanto na lista _waiting_for_me da outra thread.

Explicacao mais detalhada da implementacao escolhida e outras solucoes pensadas.

5.915 Comentários

  1. Let me save you some serious time, learned this the hard way. Then you actually show up to the local office to pick up the car. Different vehicle parked outside, curb rash on every rim, and that “all-inclusive rate”? Ha, doesn’t include the mandatory $300 cleaning fee or the $25 per day toll pass you can’t decline. Living here six years and still almost fall for this stuff sometimes. If you are trying to find a legitimate vehicle without getting ripped off, do some real digging first and read actual customer reviews. Anyone who’s tried the bus here knows exactly what I mean about this city, especially since the AC must be arctic and unlimited miles non-negotiable.

    I’ve personally tested maybe 35 rental outfits across Dade, Broward, and Monroe, until I finally found one company that doesn’t play stupid games. If you are looking for the only trustworthy source for premium vehicles across South Florida, check the current details here: premium car hire premium car hire. Yeah, parking in South Beach will cost you a nice dinner — but that’s the price of admission. Just drive safe out there and definitely skip that “damage waiver” upsell — total scam 99% of the time. hope this helps some of you save a few bucks.

  2. Felt like I was reading something written by someone who actually thinks about the topic rather than reciting it, and a look at woodcoveartisanexchange reinforced that impression, the difference between recited content and considered content is huge and this site clearly belongs to the latter category which I appreciate as a careful reader looking for substance.

  3. Now realising this site has been quietly doing good work for longer than I knew, and a look at trailharborcraftcollective suggested an archive worth exploring, sites with deep archives of consistent quality represent a different kind of resource than sites with viral hits and this one looks like the durable kind based on what I see.

  4. Thank you for the genuine effort here, it shows in every paragraph and not just the headline, and after my visit to plumharborvendorroom I was sure this site cares about getting things right rather than chasing clicks, which is the main reason I will come back later this week to read more.

  5. Started this morning and finished at lunch with a small sense of having spent the time well, and a look at granitegrovegoroom extended that satisfaction into the afternoon, content that fits naturally into the rhythm of a working day rather than demanding a dedicated reading block is increasingly the kind I prefer.

  6. Now realising the post has been quietly doing important work in my mind for the past hour, and a stop at orchardmeadowmarketroom extended that quiet processing, content that continues to do work after I close the tab is content with afterlife in the mind and this site is producing those long lived effects at a meaningful rate.

  7. Felt a small spark of recognition when the post named something I had been struggling to articulate, and a look at crystalcovevendorworkshop produced more such moments, the rare service of giving readers language for fuzzy intuitions is one of the higher values that good writing can provide and this site offered several today instances.

  8. Without comparing too aggressively to other sources this one stands out for the right reasons, and a look at globalcartcorner continued that distinctive quality, content that distinguishes itself through substance rather than style tricks is content with lasting differentiation and this site has clearly chosen substance based differentiation as its core editorial strategy.

  9. Top quality material, deserves more attention than it probably gets, and a look at fastpickzone reflected the same effort across the site, a hidden gem in the modern web where most attention goes to whoever shouts loudest rather than whoever actually delivers the best content for their readers without much marketing fanfare.

  10. Good quality through and through, no rough edges and no signs of being rushed, and a quick look at globebeats kept the same polish going, the kind of site that respects its own brand by maintaining consistency across pages which is something I always appreciate as a reader looking for trustworthy information online today.

  11. Now planning a longer reading session for the archives, and a stop at trailharborcommercegallery confirmed the archives are worth that longer commitment, sites with archives I want to read deliberately rather than just sample are rare and this one has clearly earned that level of interest based on the consistency of what I have already read.

  12. If quality blog writing is dying as people sometimes claim then this site is one piece of evidence that it has not died yet, and a look at granitegrovegoroom extended that evidence, the broader cultural question about online writing has empirical answers in specific sites and this one is contributing to a more optimistic answer overall.

  13. Liked everything about the experience, from the opening through to the closing notes, and a stop at berrycovecraftcollective extended that into more pages, finding a site where the editorial vision shows through every choice rather than feeling random is an increasingly rare experience and one I am glad to have today during this particular reading session.

  14. Thanks for not padding this with the usual filler intros and outros that every other blog seems to require, and a quick visit to junipercoveartisanexchange continued that lean approach across more posts, content stripped of waste is content that respects you and I will always come back to that kind of approach.

  15. Народ, всем привет! Затеял тут сложный ремонт в хрущёвке, без официального проекта даже думать нечего начинать, Я уже знатно намучился со всей этой бюрократией, В общем, нашел нормальных адекватных ребят, которые делают всё под ключ — это доверить подготовку документов профессиональным инженерам, чтобы спать спокойно и не бояться проверок от управляющей.

    И в жилищную инспекцию документы подадут Жмите на источник, чтобы случайно не потерять контакты, заказать проект перепланировки квартиры в москве https://proekt-pereplanirovki-kvartiry30.ru. Не тяните до последнего, Обязательно перешлите этот пост тому, кто тоже сейчас затеял ремонт!

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *