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.

10.024 Comentários

  1. A piece that took its time without dragging, and a look at clickswitch kept the same patient pace, the difference between unhurried and slow is a fine editorial distinction and this site has clearly found the unhurried side without slipping into the slow side which would have lost me as a reader quickly otherwise.

  2. Appreciated how the post felt complete without overstaying its welcome, and a stop at shopclicky confirmed that economical approach runs across the site, knowing when to stop is a skill many writers never develop but here the discipline is obvious and welcome from the perspective of a busy reader trying to learn things efficiently.

  3. Considered as a whole this site has developed a coherent point of view that comes through in individual pieces, and a look at bluestreammarket continued displaying that coherence, sites with a unified perspective rather than a grab bag of takes are sites with editorial maturity and this one has clearly developed that maturity through years of work.

  4. This one is staying open in a tab for the rest of the day so I can come back and re read certain parts, and a look at bondtrue suggests I will be doing the same with a few more pages here too, this is going to be a deep dive over the coming hours.

  5. roulette odds united statesn, united states online casino slots and all australian manson casino (Shanon) bonus codes, or
    united statesn online no deposit pokies

  6. Closed several other tabs to focus on this one as I read, and a stop at bronzewillowboutique held my undivided attention the same way, content that earns full focus in an attention environment full of competing pulls is content doing something genuinely well and the team behind it deserves recognition for that achievement consistently.

  7. A piece that was confident enough to leave some questions open rather than forcing closure, and a look at bondline continued that intellectual honesty, content that admits the limits of its scope is more trustworthy than content that pretends to total understanding and this site has the right calibration on certainty consistently.

  8. Worth saying this site reads better than most paid newsletters I have tried, and a stop at sentinelbond confirmed that comparison, the bar for free content is often lower than for paid but this site clears the paid bar consistently and that says something about the editorial approach behind the work being published here regularly.

  9. Ребята, кто реально ставит? А служба поддержки молчит как рыба и не отвечает. Искал реально долго, перепробовал кучу сомнительных вариантов до тех пор, не протестировал единственное место, где реально не кидают начиная от удобного интерфейса и заканчивая официальной лицензией. Вывод честно заработанных денег занимает буквально 5 минут,

    Кому тоже актуально найти проверенное место для игры, смотрите сами все условия по ссылке ставка на спорт кыргызстан ставка на спорт кыргызстан Лучше обходить стороной забаненные платформы и выбирать надежные зоны. обязательно перешлите этот post тому, кто тоже сейчас ищет нормальную контору!

  10. Reading this confirmed a hunch I had been carrying about the topic without having articulated it, and a stop at mosslightemporium 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.

  11. KennethPab KennethPab

    Сравните нашу клинику с другими наркологическими клиниками и стационарами: мы гарантируем не только доступные цены, но и высочайшее качество медицинской помощи. Наши специалисты ежедневно проводят вывод из запоев, детоксикацию и кодирование. В арсенале врачей — только проверенные препараты и оборудование. Капельница на дому также возможна, однако стационарное лечение позволяет полностью контролировать состояние пациента, что особенно важно при тяжелых отравлениях алкоголем. Мы несем ответственность за здоровье каждого человека, доверившегося нам. У нас есть все необходимые сертификаты и лицензии, а положительные отзывы клиентов подтверждают высокий уровень услуг.
    Подробнее – вывод из запоя на дому

  12. A piece that read as the work of someone who reads carefully themselves, and a look at mosslightemporium continued that informed feel, writers who are also serious readers produce work with a different quality and this site reads as the product of someone steeped in good writing rather than just generating content for an audience.

  13. Honestly the simplicity of the explanation made the topic click for me in a way other writeups had not, and a look at puretrustbond continued that clarity into related areas, when a writer gets the level of explanation right the reader does the heavy lifting themselves and the post just enables it.

  14. Worth a slow read rather than the fast scan I usually default to, and a look at hollowcreekoutlet earned the same slower pace from me, content that resets my reading speed downward is content with substance worth absorbing and this site has produced that effect on me multiple times now over the last week here.

  15. Now appreciating the way the post avoided the temptation to be longer than necessary, and a look at bondlynx continued that lean approach, content with the discipline to stop when finished rather than padding for length is content that respects both itself and its readers and this site has that disciplined editorial culture clearly throughout.

  16. united kingdom real money online casino, best casino app new
    zealand and dollar 5 deposit online when will ameristar casino st charles
    open (Laura) australia,
    or new zealandn roulette games

  17. Reading this in pieces over a coffee break and finding it consistently rewarding, and a stop at clicktolearnmore extended that into related material I will return to later, the kind of site that fits naturally into small reading windows without requiring a long uninterrupted block is genuinely useful for how I actually browse.

  18. Came across this through a roundabout path and now it is on my regular rotation, and a stop at clicktowinonline 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.

  19. Really liked the calm tone running through the post, no shouting and no urgency forced into the writing, and a look at bondsteady kept that quiet confidence going, the kind of voice that makes the reader feel respected rather than yelled at which is depressingly common across most modern blog content these days.

  20. Decided this was the kind of site I would defend in a discussion about good blog content, and a stop at ikbarmeryansus reinforced that, very few sites earn active defence rather than passive consumption and this one has clearly crossed that threshold for me without needing any explicit pitch from the writers themselves either.

  21. Recommended to anyone working in or curious about this area, the depth and clarity combine well, and a look at nextgenshoppinghub keeps that going across more pages, the kind of site that earns regular visits rather than chasing trends has my respect because it suggests genuine commitment to the topic itself rather than to chasing trends.

Deixe um comentário

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