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.

9.564 Comentários

  1. Following a few of the internal links revealed more posts of similar quality, and a stop at optiorder added more to that growing pile, sites where internal links lead to more good content rather than to more of the same recycled material are sites with depth and this one has clearly built that depth carefully.

  2. Bookmarking this for later, the kind of resource I want to keep nearby, and a quick look at blog33never confirmed the rest of the site is worth the same treatment, definitely going into my reference folder for the next time the topic comes up at work or in conversation with someone who asks.

  3. Worth flagging that this approach to the topic is fresh without being contrarian, and a stop at joltcloud extended the same fresh angle, finding original perspective on familiar subjects is rare and this site has clearly developed its own way of seeing rather than echoing the dominant takes from elsewhere consistently.

  4. Spent a few minutes here and came away with a clearer picture of the topic, the writing keeps things simple without dumbing them down, and after a stop at blog33memorys the rest of the points lined up neatly which is something I appreciate when I am short on time and need answers fast.

  5. The examples really helped me grasp the points faster than abstract descriptions would have, and a stop at buildbit added a few more practical illustrations that drove the message home, the kind of writing that knows its readers learn better through concrete situations rather than vague generalities is rare and worth recognising clearly.

  6. Thanks for the readable length, I finished it without checking how much was left, and a stop at fluentform kept me reading the same way, when I stop noticing the length of a piece because the content is engaging enough to sustain attention without willpower the writer has done their job well today.

  7. A welcome reminder that thoughtful writing still happens online, and a look at appultimate 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.

  8. Davidagelt Davidagelt

    Чтобы оформить запись, позвоните в центр или оставьте контактную форму на сайте. Если удобнее написать, укажите номер телефона и адрес — сотрудник перезвонит. В некоторых случаях связь также поддерживается через WhatsApp. Главная задача первого разговора — понять срочность обращения и подготовить специалиста к выезду, а не поставить диагноз дистанционно.
    Получить больше информации – http://k.vyvod-iz-zapoya-kemerovo18.ru

  9. Hi there! Do you know if they make any plugins to protect against hackers? I’m kinda paranoid about losing everything I’ve worked hard on. Any suggestions?

  10. Reading this with a notebook open turned out to be the right move, and a stop at joltcloud added more material to the notes, content that justifies active note taking from a passive reader is content with real informational density and this site is producing notes worthy material at a high rate consistently.

  11. Здорова, народ Ситуация критическая Дети напуганы Таблетки не помогают Короче, только это реально спасло — нарколог на дом анонимно с препаратами Приехал через 40 минут В общем, не потеряйте контакты — срочный вызов нарколога на дом срочный вызов нарколога на дом Не ждите пока станет хуже Перешлите тем кто в такой же ситуации

  12. Здорова, народ Брат снова сорвался Родственники не знают что делать Таблетки не помогают Короче, единственный кто реально помог — частный нарколог на дом с капельницей Дал рекомендации и успокоил семью В общем, не потеряйте контакты — нарколог на дом цены https://czena.narkolog-na-dom-sankt-peterburg014.ru Не ждите пока станет хуже Перешлите тем кто в такой же ситуации

Deixe um comentário

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