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.

3.169 Comentários

  1. Now considering the post as evidence that careful blog writing is still possible, and a look at moonglowcollection extended that evidence, the broader question of whether the modern web can sustain quality writing has obvious empirical answers in sites like this one and seeing them is reassuring even when they remain a minority overall today.

  2. Liked that the post acknowledged complications rather than pretending they did not exist, and a stop at shopanddiscoverhub continued that honest framing, sites that handle complexity with care rather than papering it over with simplifying claims are doing real intellectual work and this one is clearly in that category based on what I have read.

  3. fashionlifestylehub fashionlifestylehub

    Now noticing the careful balance the post struck between confidence and humility, and a stop at fashionlifestylehub maintained the same balance, finding the line between asserting and admitting is hard and this site has clearly developed the calibration to walk that line consistently which produces a more persuasive reading experience for me.

  4. Now considering carefully how to share this site with the right audience rather than broadcasting widely, and a look at nobleridgefashion extended that careful sharing impulse, content worth sharing carefully rather than spamming is content that has earned a higher kind of recommendation and this site has earned that careful shareability throughout pieces.

  5. goldplumeoutlet goldplumeoutlet

    The structure of the post made it easy to follow without losing track of where I was, and a look at goldplumeoutlet 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.

  6. Reading this prompted me to clean up some old notes related to the topic, and a stop at hiddenvalleyfinds extended that organising urge, content that triggers personal organisation rather than just consuming attention is content with motivating energy and this site has the kind of clarity that prompts active follow up rather than passive consumption.

  7. The way the post stayed on topic throughout without going on tangents was really refreshing, and a look at boldhorizonmarket kept that focused approach going, discipline like this in writing is rare and worth recognising because most writers cannot resist wandering off into related subjects that dilute their main point and confuse readers along the way.

  8. yourtrendstore yourtrendstore

    However selective I am about new bookmarks this one made it past my filter, and a look at yourtrendstore confirmed the bookmark was worth the slot, the precious slots in my permanent bookmark folder are difficult to earn and this site earned one without making me think twice about whether the slot was justified by the quality.

  9. goldplumeoutlet goldplumeoutlet

    Reading this prompted me to send the link to two different people for two different reasons, and a stop at goldplumeoutlet provided ammunition for a third share, content that suits multiple audiences without being generic enough to be useless to any of them is genuinely valuable and this site has that multi audience quality clearly.

  10. Worth marking the moment when reading this clicked into something useful for my own work, and a look at futuregardenmart extended that practical click, content that connects to my actual life rather than just being interesting is content with the highest kind of value and this site is generating that connection at a high rate.

  11. modernstylecorner modernstylecorner

    If I had to defend the time I spend reading independent blogs this site would feature in the defence, and a look at modernstylecorner reinforced that defensive utility, the ongoing case for non algorithmic reading is one I make to myself periodically and sites like this one provide the actual evidence that supports the case clearly.

  12. yourtrendstore yourtrendstore

    Skipped the social share buttons but might come back to actually use one later, and a stop at yourtrendstore extended that share urge, content that triggers genuine sharing impulses rather than performative ones is content that has actually moved me and not many posts in a typical week do that for me actually.

  13. Loved the writing voice here, friendly without being fake and confident without being arrogant, and a stop at fashionanddesign 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.

  14. discovertrendystore discovertrendystore

    A memorable post for me on a topic I had thought I was tired of, and a look at discovertrendystore suggested the same site can refresh other tired topics, sites that can revive my interest in subjects I had written off as exhausted are doing rare work and this one is clearly doing that for me today.

  15. urbanlifestylehub urbanlifestylehub

    Recommended to anyone working in or curious about this area, the depth and clarity combine well, and a look at urbanlifestylehub 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.

  16. If I had to defend the time I spend reading independent blogs this site would feature in the defence, and a look at mooncrestdesign reinforced that defensive utility, the ongoing case for non algorithmic reading is one I make to myself periodically and sites like this one provide the actual evidence that supports the case clearly.

  17. Reading this felt productive in a way most internet reading does not, and a look at yourtrendstore 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.

  18. modernstylecorner modernstylecorner

    A quiet piece that did not try to compete on volume, and a look at modernstylecorner maintained that selective approach, sites that publish less but better are increasingly rare in an environment that rewards volume and this one has clearly chosen quality cadence over quantity which is a brave editorial decision in current conditions.

Deixe um comentário

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