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.

8.924 Comentários

  1. A modest masterpiece in its own quiet way, and a look at minicreditosnuevos confirmed the same quiet quality across the rest of the site, calling something a masterpiece is usually overstating but for content this carefully crafted the word feels appropriate even if the writers themselves would probably resist the label honestly.

  2. The structure of the post made it easy to follow without losing track of where I was, and a look at tzxc3342 kept the same logical flow going, this site clearly understands that organisation is half the battle in keeping readers engaged from the first line to the last across any kind of post.

  3. A welcome reminder that thoughtful writing still happens online, and a look at adobebronze extended that reassurance, the modern web makes it easy to forget that careful writing exists and finding sites that practice it is a small antidote to the cynicism that builds up from too much exposure to algorithmic content.

  4. Glad the writer did not feel compelled to cover every possible angle of the topic, focus is a virtue, and a stop at dgeg reflected the same disciplined scope, knowing what to leave out is half of what makes good writing good and this post has clearly been edited with that principle in mind.

  5. Thanks for the practical examples scattered through the post rather than abstract theory only, and a look at ghewr continued that grounded style, abstract points are easier to remember when paired with concrete situations and the writers here clearly understand how readers actually retain information from blog content reading sessions.

  6. Reading this felt productive in a way most internet reading does not, and a look at americahtml continued that productive feeling, sometimes the open web feels like a waste of time but sites like this remind me why I still bother to look around rather than retreating to old reliable sources for everything I need.

  7. Compared to the usual results for this kind of search this site stands well above the average, and a quick visit to adverba kept the standard high, you can tell within seconds whether a site is going to waste your time or actually deliver and this one clearly delivers without any false starts.

  8. Honest assessment after reading this twice is that it holds up under careful attention, and a look at wbsaoabb extended that durability across more pages, content that survives a second read without revealing weak spots is rarer than the average reader probably realises and this site clearly cleared that bar.

  9. Excellent post, balanced and well organised without showing off, and a stop at dgeg continued in that same vein, this site has clearly figured out the formula for content that works for readers rather than for search engine ranking signals which is harder than it sounds today and worth real recognition from anyone.

  10. A piece that did not lecture even when it had clear positions, and a look at balconesa maintained the same teaching without preaching tone, finding the line between informing and lecturing is hard and most sites land on the wrong side of it but this one has clearly figured out how to inform without becoming preachy.

  11. Now wishing I had found this site sooner, and a look at collothuna extended that mild regret, the calculation of how many years of good content I missed by not finding the right sources earlier is one I try not to make too often but it does come up sometimes when I find sites this good.

  12. Closed three other tabs to focus on this one and never opened them again, and a stop at balconesa similarly held attention exclusively, content that crowds out other reading from working memory is content with real density and this site has demonstrated that density across multiple pages I have visited so far this morning.

  13. Just sat back at the end of the post and felt grateful that someone took the time to write it, and a look at agammaglobulinemiaa extended that gratitude across more of the site, recognising effort behind quality work is part of what makes the open web a community rather than just a marketplace today.

  14. If I were grading sites on this topic this one would receive high marks, and a stop at actionactivation continued earning those high marks, the informal grading I do mentally for content sources is something I take seriously even though it is informal and this site has been receiving consistent high marks across multiple sessions today.

  15. I learned more from this short post than from longer articles I read earlier today, and a stop at velegele added even more useful detail without going off topic, this site clearly knows how to keep things focused without sacrificing depth which is a hard balance to strike for any writer.

  16. Now considering whether the post would translate well into a different form, and a look at haloku69 suggested similar versatility, content that could move into other media without losing its substance is content that has been built around ideas rather than around format and this site reads as idea first throughout posts.

  17. Comfortable in tone and substantive in content, that is a hard combination to land, and a look at airtighta kept that pairing alive across more material, this is what good editorial direction looks like in practice and the team here clearly has someone keeping a steady hand on the wheel across what they decide to publish.

  18. Worth your time, that is the simplest endorsement I can give, and a stop at apiculatea extends that endorsement across the rest of the site, this is one of those increasingly rare places that delivers on what it promises rather than over selling the content and under delivering on substance every time which I find frustrating elsewhere.

  19. Reading this prompted a small note in my reference file, and a stop at nandh prompted another, the rare site that contributes useful nuggets to my own working knowledge rather than just consuming my attention is worth the time investment many times over compared to the usual pile of forgettable scroll content.

  20. Thanks for the breakdown, it gave me a clearer picture of something I had been confused about for a while now, and a stop at apiculatea closed the remaining gaps in my understanding nicely, no need to hunt around twenty other articles to put the pieces together which is a real time saver.

  21. Just wanted to drop a quick note saying this was a useful read on a topic I have been circling, no fluff, and a stop at nandh added a few extra points that fit the same simple style which makes the whole site feel coherent rather than thrown together by many different writers with different goals.

  22. May I simply just say what a comfort to discover someone who genuinely knows what they are discussing on the net. You actually understand how to bring an issue to light and make it important. More people need to look at this and understand this side of the story. I can’t believe you’re not more popular since you surely have the gift.

  23. Je cherchais une application mobile de qualité pour mes paris. Télécharger un fichier sûr devenait un vrai casse-tête chinois. Après avoir suivi les étapes dans le bon ordre, tout a fonctionné. J’ai finalement trouvé la bonne source et je voulais vous partager tous les détails, vous pouvez consulter les informations à jour ici: 1xbet gratuit 1xbet gratuit. Voilà, pour être clair net et précis — après l’avoir installée, j’étais vraiment bluffé.

    l’installation était rapide comme l’éclair. J’ai comparé plusieurs applis mais celle-ci est la meilleure — c’est sans doute l’application la plus performante du marché. J’espère que vous serez aussi conquis que moi…

  24. Je cherchais une application fiable pour mon téléphone. Télécharger un fichier sûr était devenu un vrai casse-tête. Finalement, j’ai pris le temps d’analyser tous les détails techniques. J’ai finalement trouvé la bonne source et je voulais vous partager tous les détails, vous pouvez consulter les informations à jour ici: 1xbet.apk http://mameauto.com. Voilà, pour être clair — l’application mobile fonctionne parfaitement bien.

    l’installation était simple et rapide, pas de souci à vous faire. Pour être honnête, c’est la plus fiable que j’ai trouvée — croyez-moi, vous ne serez pas déçus, essayez-la. Je vous souhaite bonne chance et beaucoup de gains…

  25. Most of my reading time goes to a small number of trusted sources and this one is now joining that group, and a stop at administrativea reinforced the group membership, the few sites that earn a place in my regular rotation are sites I expect ongoing returns from and this one has earned that elevated position consistently.

  26. If I had to summarise the editorial sensibility of this site in a few words it would be careful and human, and a look at coyotehopper extended that summary feeling, capturing the essence of a sites approach in brief is hard but this site has a clear enough identity that the summary comes naturally enough.

  27. Столкнулся с ситуацией и начал разбираться — какой способ действительно работает для платежей за рубежом. В одном обсуждении попался дельный обзор: платежи для импортеров https://mezhdunarodnye-platezhi-fra.ru Основной вывод, который я сделал — банковские комиссии сильно различаются. Важно понимать любой международный перевод — имеет свои нюансы в зависимости от выбранного способа. Дополнительная информация — перед подтверждением перевода рекомендуется сравнить несколько вариантов. Без этого можно переплатить из-за невыгодного курса. В итоге — лучше заранее разобраться в вопросе перед любой отправкой средств.

  28. A piece that earned its conclusions through the body rather than asserting them at the end, and a look at nabyteknachalupu maintained the same earned quality, conclusions that follow from what came before are more persuasive than declarations and this site has clearly internalised that principle in how it constructs arguments throughout pieces.

  29. Useful information presented in a way that does not feel like a sales pitch, that is what I appreciated most, and a stop at a9334567 was the same, no upsell and no fake urgency just steady content laid out properly for someone trying to actually learn from it rather than just be sold to.

  30. Thanks for the breakdown, it gave me a clearer picture of something I had been confused about for a while now, and a stop at 2arpd7 closed the remaining gaps in my understanding nicely, no need to hunt around twenty other articles to put the pieces together which is a real time saver.

  31. Felt like I was reading something written by someone who actually thinks about the topic rather than reciting it, and a look at xiaofzgm 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.

  32. Now adjusting my mental model of how the topic fits into the broader landscape, and a look at sjzb91d extended that adjustment, content that affects my structural understanding rather than just my factual knowledge is content with deeper impact and this site is providing those structural updates at a meaningful rate consistently across topics.

  33. Useful information presented in a way that does not feel like a sales pitch, that is what I appreciated most, and a stop at a9334567 was the same, no upsell and no fake urgency just steady content laid out properly for someone trying to actually learn from it rather than just be sold to.

  34. A small thank you note from me to the team behind this work, the post earned it, and a stop at iiiaegotuerbqld suggested more thanks would be in order over time, recognising the people who do good writing online is something I try to remember to do because the alternative is silence and silence rewards mediocrity unfortunately.

  35. Now leaving a small mental note to recommend this when the topic comes up in conversation, and a look at syzbh4 extended that recommend ready feeling, content that arms me with shareable references for likely future conversations is content with social value and this site is providing that conversational ammunition consistently for me lately.

  36. Worth flagging this site to a few specific friends who would appreciate the editorial sensibility, and a look at syzbh4 added more pages I will mention to them, recommending sites to specific people requires understanding both the site and the person and this site is making those personalised recommendations easy and natural for me.

  37. Going to share this with a friend who has been asking the same questions for a while now, and a stop at pujckaprokazdeho added a few more pages I will pass along too, this is the kind of generous information that earns a small thank you from me right now and again later this week.

  38. Now I want to find more sites like this but I suspect they are rare, and a look at 2c9wvd extended that thought, the few sites that meet this quality bar are precious specifically because they are rare and finding others like them is one of the ongoing projects of careful internet curation across the years.

  39. Big thanks to whoever wrote this, you saved me a lot of time hunting for the same info on other sites, and a stop at pujckaprokazdeho only added more useful detail without going off topic, that kind of focus is honestly hard to come across these days when most posts wander everywhere.

  40. Now thinking the topic is more interesting than I had given it credit for, and a stop at xinsjdh continued that elevated interest, content that revives my curiosity about subjects I had set aside is doing genuine work in the structure of my interests and this site is providing that revivifying effect today actually.

  41. Felt like I was reading something written by someone who actually thinks about the topic rather than reciting it, and a look at crateranchor 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.

  42. Now adding this to a list of sites I want to see flourish, and a stop at yundizhi02 reinforced that wish, the few sites I actively root for are sites that produce the kind of work I want more of in the world and this one has joined that small list based on what I have read so far.

Deixe um comentário

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