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

  1. Solid value for anyone willing to read carefully, and a look at ulvirotrust extends that value across the rest of the site, this is the kind of place that rewards return visits rather than offering everything in a single splashy post and then leaving readers nothing to come back for later which is unfortunately common.

  2. Closed several other tabs to focus on this one as I read, and a stop at brixo 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.

  3. Now feeling the small relief of finding writing that does not condescend, and a stop at pier45attheport extended that respect for readers, content that treats its audience as capable adults rather than as people to be managed produces a different reading experience and this site has clearly chosen the respectful approach across all pieces.

  4. Now setting this aside as a model of how to write thoughtfully on the topic, and a stop at rixaroholdings extended that model status, content that becomes a reference for how a kind of writing should be done is content with influence beyond its own readership and this site is reaching that level for me clearly today.

  5. RoscoeNup RoscoeNup

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

  6. Ребята у кого дача Объездил кучу контор — везде одно и то же То вообще приезжают и говорят что замер не тот Короче, нашел нормальных ребят — производство и монтаж заборов любой сложности И установили всё чисто В общем, вся инфа вот здесь — 3D забор под ключ 3D забор под ключ Проверяйте производителя по этому списку Перешлите тому у кого участок

  7. Владельцы участков отзовитесь Цены космос а качество мыло То материал фуфло Короче, мужики с руками из правильного места — купить забор с установкой от производителя И установили всё чисто В общем, жмите чтобы не потерять — установка заборов в Московской области установка заборов в Московской области Проверяйте производителя по этому списку Перешлите тому у кого участок

  8. Refreshing tone compared to the dry corporate posts on similar topics, and a stop at ulvarobondgroup carried that personality through nicely, you can tell when a real person is behind the writing versus a content team chasing metrics and this site definitely falls into the former category clearly across what I have seen.

  9. Genuine pleasure to read, and that is not something I say often after a casual click through, and a quick visit to ulvarobonding kept the same feeling going across the rest of the site, finding writing that actually feels good to spend time with rather than just functional is increasingly rare on the open web.

  10. Reading this in three sittings because the day was fragmented, and the piece survived the fragmentation, and a stop at zavirobase held up under similar reading conditions, content engineered for continuous attention is fragile in modern conditions and this site reads as durable across the realistic ways people consume content today.

  11. Appreciate how nothing here feels copied or pieced together from other places, the voice is consistent and the tone stays human, and after I checked mivaromart I noticed the same style holds, which is a small detail but it makes the whole experience feel personal rather than like another generic site.

  12. DanielZoope DanielZoope

    Помощь оказывают врачи с практикой в наркологии, психиатрии и восстановительной терапии.
    Углубиться в тему – vyvod-iz-zapoya-v-stacionare-moskva

  13. Took a screenshot of one section to come back to later, and a stop at xelivocapital 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.

  14. Ребята кто ищет подарки Вечно то выбор скудный Либо дорого, либо не то Короче, нашел отличный магазин — магазин эксклюзивных подарков с гарантией Цены ниже рынка В общем, сохраняйте себе — премиальные подарки для мужчин премиальные подарки для мужчин Не переплачивайте в обычных магазинах Перешлите тому кто ищет подарки

  15. Thanks for your writing. I would also like to say that your health insurance dealer also works best for the benefit of the actual coordinators of your group insurance policy. The health insurance professional is given a long list of benefits desired by somebody or a group coordinator. What any broker does indeed is seek out individuals or even coordinators which often best fit those desires. Then he gifts his advice and if the two of you agree, the broker formulates binding agreement between the 2 parties.

  16. Vague feelings of recognition kept surfacing as I read because the writing names things I have been thinking, and a look at qelarotrustco produced more of those recognition moments, content that gives shape to private intuitions is content that makes me feel less alone in my own thinking and this site has that effect.

  17. Took something from this I did not expect to find, and a stop at qelarotrust added another unexpected useful piece, content that exceeds expectations rather than just meeting them is the kind that builds enthusiasm and earns repeat visits without any explicit ask from the writer or platform behind the work being read.

  18. Honestly thank you to whoever wrote this because it scratched an itch I had not quite been able to articulate, and a stop at kryvoxstore kept that satisfying feeling going, the kind of writing that meets unspoken needs is special and this site clearly has writers who understand their readers more than most do today.

  19. Found this via a link from another piece I was reading and the click was worth it, and a stop at cavarounion extended the value across more material, the open web still rewards clicking through citations when the underlying writers care about each other work and this site clearly belongs to that network.

  20. Better signal to noise ratio than most places I check on this kind of topic, and a look at qelaroline kept that going, every paragraph here carries something worth reading rather than padding out the page to hit some arbitrary length target that search engines reward but readers ignore as soon as they notice it.

  21. Слушайте кто сталкивался Брат снова сорвался Жена в истерике Таблетки не помогают Короче, врач приехал и поставил систему — нарколог домой с выездом Осмотрел и поставил капельницу В общем, телефон и цены тут — вызов нарколога круглосуточно https://kodirovanie.narkolog-na-dom-voronezh17.ru Звоните прямо сейчас Перешлите тем кто в такой же ситуации

  22. free spin no big first deposit bonus casino (Ewan) casino australia, united statesn online pokies paysafe
    and canada best slot machine, or best casino in australia online

  23. Found this through a friend who recommended it and now I see why, and a look at ulvirobondgroup only strengthened that recommendation in my own mind, word of mouth still works for content that actually delivers and this site is clearly earning recommendations the old fashioned way through quality rather than marketing.

  24. Appreciated that the writer trusted the reader to follow along without constant restating of earlier points, and a look at plivoxstore continued that respect for the reader, treating an audience as capable adults rather than as people to be hand held through every paragraph is something I notice and value highly across the open internet today.

Deixe um comentário

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