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.939 Comentários

  1. Granted I am giving this site more credit than I usually give new finds, and a look at dailyneedsstore continued earning that credit, the calibration of how much trust to extend after limited exposure is something I do carefully and this site has earned more trust on shorter exposure than most due to consistent quality across.

  2. Bookmark moved to my permanent reference folder rather than the casual maybe later folder, and a look at kettleharborcommercegallery earned the same upgrade, the distinction between casual interest and lasting reference is something I track carefully and very few sites cross that threshold but this one did so without much effort apparently.

  3. Grateful for posts like this one, they remind me there are still places online run by people who care about quality, and a look at futurecartcorner reflected the same standards, you can tell the difference between content made for readers and content made just for search engines today and this is the former.

  4. If the topic interests you at all this is a place to spend time, and a look at pearlharborvendorparlor reinforced that recommendation, the broader question of where to invest topical reading time is one this site answers convincingly through the consistent quality across multiple pieces I have sampled during the current reading session today.

  5. Took a screenshot of one section to come back to later, and a stop at walnutharborvendorparlor prompted another saved tab, the urge to capture and revisit specific pieces of content is something I rarely feel but when I do it tells me the work is worth more than the average passing read for sure.

  6. Felt like the post had been edited rather than just drafted and published, and a stop at futurecartcorner suggested the same care across the site, the difference between edited and unedited content is enormous for the reader and this site has clearly invested in the editing pass that most blogs skip entirely which really does show up.

  7. A piece that did exactly what it promised in the headline without overshooting or underdelivering, and a look at salutesyrup continued that calibration, alignment between promise and delivery is a basic editorial virtue that many sites fail at and this site has clearly mastered the matching of expectation and substance throughout pieces.

  8. Took longer than expected to finish because I kept stopping to think, and a stop at swordtunic did the same to me, content that provokes thought rather than just delivering information is in a different category and the team here is clearly working at that higher level rather than just cranking out posts.

  9. Solid endorsement from me, the writing earns it, and a look at hullgale continues to earn it across the broader site too, the kind of operation that maintains quality across many pages rather than just one viral post is a sign of serious commitment and that is what I see here clearly across what I read.

  10. Closed the laptop after this and let the ideas settle for a few hours, and a stop at seacovecraftcollective similarly rewarded reflective time, content that benefits from sitting with rather than racing past is the kind I want more of and the kind that this site appears to consistently produce week after week here.

  11. Looking at this objectively the editorial quality is hard to deny even setting aside personal taste, and a stop at deoblob maintained the same objective quality, the gap between what I personally enjoy and what is objectively well crafted exists and this site clears both bars simultaneously which is rarer than it sounds.

  12. Glad the writer did not feel the need to argue with imaginary critics in the post itself, and a stop at villageswan kept the same focused approach going, defensive writing wastes the reader time and confidence on positions that did not need defending and this post has clearly avoided that common failure.

  13. Picked up on several small touches that suggest a careful editor, and a look at aroarch suggested the same hand at work across the broader site, editorial consistency at a granular level is one of the strongest signs that an operation is serious rather than just hobbyist and this site reads as serious throughout.

  14. Looking back on this reading session it stands as one of the better ones recently, and a look at lanternorchardmerchantgallery extended that ranking, the informal ranking of reading sessions against each other is something I do mentally and this session ranks high largely because of this site and a couple of related pages here.

  15. A piece that read as if the writer was thinking carefully rather than just typing fluently, and a look at deoblob continued that considered quality, the difference between fluent typing and careful thinking shows up in writing and this site reads as the product of thought rather than just the product of language fluency apparently.

  16. Thanks for taking the time to write this, it is clear that some thought went into how each point would land, and after I went through rainharbormarketgallery I had a better grip on the topic, real value without the usual marketing noise people have to put up with online when searching for answers.

  17. Народ всем привет Обещают сертификаты а по факту Китай То тельферы клинят Короче, нашел нормальных производителей — оборудование для подъема грузов до 50 тонн Установка и пусконаладка В общем, сохраняйте себе — монтажная лебедка https://tal-elektricheskaya.ru Проверяйте производителя по документам Перешлите тому кто ищет оборудование

  18. Just nice to read something that does not feel like it was assembled from a content brief, and a stop at honeycovemerchantgallery kept that handcrafted feel going, you can tell when a real human with real understanding is behind the words versus a templated piece churned out for an algorithm to find.

  19. Just sat back at the end of the post and felt grateful that someone took the time to write it, and a look at huiyam 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.

  20. StevenLow StevenLow

    В этом обзоре представлены различные методы избавления от зависимости, включая терапевтические и психологические подходы. Мы сравниваем их эффективность и предоставляем рекомендации для тех, кто хочет вернуться к трезвой жизни. Читатели смогут найти информацию о реабилитационных центрах и поддерживающих группах.
    Читать полностью – вывод из запоя на дому цена

  21. Excellent execution from start to finish, the post never loses its rhythm and the points stay sharp, and a quick stop at aroarch kept the same level going, consistency like this across a site is the marker of a serious operation rather than a casual side project running on autopilot somewhere else.

  22. Quietly the post solved something I had been turning over without quite knowing how to phrase the question, and a look at velvetbrooktradegallery extended that quiet solving, content that addresses unformulated needs is content with reader insight and this site has demonstrated that insight at a high rate across the pieces I have read recently.

  23. Probably going to mention this site in a write up I am working on later this month, and a stop at steamsaunter provided more material for that potential mention, content worth referencing in my own published work rather than just personal reading is content with the highest endorsement level and this site has earned that endorsement.

  24. My professional context would benefit from having this kind of resource available, and a look at dailycartdeals extended the professional applicability, the rare site that contributes meaningfully to professional work rather than just personal interest is content with multiplied value and this one is providing that professional utility consistently across multiple pieces.

  25. Really like that the writer trusts the reader to follow simple logic without restating every previous point, and a stop at elmwoodgoodsroom kept that respect going, treating an audience as capable adults rather than as people who need constant hand holding makes a noticeable difference in the reading experience for me.

  26. The whole experience of reading this was pleasant from start to finish, no pop ups and no annoying interruptions, and a look at humgrain continued that clean experience, technical choices about page design matter for the reader and this site clearly cares about the small details that add up to comfort across multiple visits.

  27. bulk poker chips united states, bitcoin gambling united
    kingdom and australian casino apps, or most legit online casino united states

    my site what is 3 to 2 blackjack (Johnette)

  28. Picked this for a morning recommendation in our company chat, and a look at clovercrestmerchantgallery suggested I will mention this site again later, recommending content into a workplace context is a small editorial act that requires confidence in the recommendation and this site is making me confident in those recommendations consistently here too.

  29. Loved the writing voice here, friendly without being fake and confident without being arrogant, and a stop at linencovemerchantgallery carried the same tone forward, the kind of personality that makes a reader feel welcome rather than lectured at which is a balance plenty of writers struggle to find no matter how long they have been at it.

  30. Will be sharing this with a couple of people who care about the topic, and a stop at jasperharbormerchantgallery added more material worth passing along, the kind of site that is generous with quality content and does not make you jump through hoops to access it which is appreciated more than the team probably realises.

  31. Bookmark earned and folder updated to track this site separately, and a look at ixaqua confirmed the folder upgrade was the right call, organising my reading list so that good sites do not get lost in a sea of casual bookmarks is something I do more carefully now and this site warranted its own spot.

  32. Georgebut Georgebut

    Эта публикация обращает внимание на важность профилактики зависимостей. Мы обсудим, как осведомленность и образование могут помочь в предотвращении возникновения зависимости. Читатели смогут ознакомиться с полезными советами и ресурсами, которые способствуют здоровому образу жизни.
    Подробнее тут – реабилитация алкоголиков в Москве

  33. Reading this on a phone at a coffee shop and finding it perfectly suited to that context, and a stop at corlex continued the comfortable mobile experience, content that works across reading conditions without compromising on substance is increasingly important and this site has clearly thought about the whole reader experience here.

  34. Strong recommendation, anyone interested in this topic owes themselves a visit, and a stop at swamptweed extends that recommendation across more of the site, this is the kind of resource that makes me more optimistic about the state of the open web than I usually am these days actually for once which is genuinely refreshing.

  35. Reading this confirmed a hunch I had been carrying about the topic without having articulated it, and a stop at everydaycartstore extended the confirmation, content that gives shape to fuzzy intuitions is doing the rare work of making private thoughts public and this site is providing that articulating service consistently for me lately.

  36. no deposit bonus casinos canada, best no deposit bonus casino usa and
    pokie machine laws united states, or online casino 300 prozent bonus;
    Kristopher, in milwausaee wi

  37. Came across this through a roundabout path and now it is on my regular rotation, and a stop at gunlex sealed that decision, the open web still produces serendipitous discoveries when you let the citations and references guide you rather than relying purely on algorithmic feeds for new content recommendations always.

  38. Thanks for the honest framing without exaggerated claims that the topic will change my life, and a stop at helmkit kept the same modest tone, restraint in marketing language signals trustworthiness and the writers here are clearly playing the long game by building credibility rather than chasing immediate clicks through hyperbole.

Deixe um comentário

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