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.

7.978 Comentários

  1. Quality you can feel from the first paragraph, the writer clearly knows the topic and how to share it, and a quick look at mexqiro confirmed the same depth runs throughout the rest of the site as well which is rare and worth pointing out when it happens online for any reader passing through.

  2. Arthurlut Arthurlut

    Наркологическая помощь позволяет безопасно начать выведение токсинов, снизить интоксикации, восстановить водно-солевой баланс и подобрать дальнейшее лечение алкогольной зависимости. Нарколог проводит анализ состояния пациента, уточняет стаж употребления спиртного, причины запоя, наличие хронического заболевания, психических расстройств, противопоказаний и других ограничений. После диагностики врач выбирает схему: амбулаторно на дому, в стационаре клиники или с госпитализацией.
    Детальнее – нарколог вывод из запоя

  3. Coming back to this one, definitely, and a quick visit to cartrivo only made me more sure of that, the kind of writing that makes you want to set aside time later rather than rushing through it now while distracted by everything else competing for attention on the screen today across so many tabs.

  4. Really nice to see things explained without overcomplicating the topic, the words flow naturally and stay easy to follow, and a short visit to civiccask only added to that experience because the same simple approach is used across the rest of the page too without any change in tone.

  5. Felt the post had been quietly polished rather than aggressively styled, and a look at urbanrivo confirmed the same understated polish, sites whose quality reveals itself slowly rather than announcing itself loudly are the kind I trust more deeply because the trust is not based on first impressions of marketing but actual substance.

  6. Picked up something useful for a side project, and a look at molzari added another piece I will incorporate, content that connects to specific projects I am working on is content with practical utility and the practical utility of this site is showing up across multiple posts I have read in the last hour or so.

  7. Closed it feeling I had taken something away rather than just consumed something, and a stop at xarvilo extended that taking away feeling, the difference between content I extract value from and content I just pass through is something I track informally and this site is consistently in the value extraction column for me.

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

  9. Слушайте кто сталкивался Близкий человек уже несколько дней в запое Соседи стучат в стену В больницу тащить страшно Короче, врачи приехали и поставили систему — капельница от запоя цена доступная Сняли ломку и стабилизировали состояние В общем, телефон и цены тут — капельница на дому район воронеж https://kapelnicza-ot-zapoya-voronezh-bqi.ru Не ждите пока станет хуже Перешлите тем кто в такой же ситуации

  10. Здорова, народ Брат снова сорвался Жена в истерике В больницу тащить страшно Короче, единственное что вытащило из запоя — капельница от запоя с витаминами и препаратами Сняли ломку и стабилизировали состояние В общем, жмите чтобы сохранить — капельницы от запоя на дому воронеж https://kapelnicza-ot-zapoya-voronezh-bqi.ru Звоните прямо сейчас Перешлите тем кто в такой же ситуации

  11. Halfway through I knew I would finish the post, and a stop at meownoon also held me through to the end, content that signals its quality early and then sustains it is content with real internal consistency and this site has clearly figured out how to maintain quality from opening sentence through to closing thought.

  12. Closed the laptop after this and let the ideas settle for a few hours, and a stop at tirlumo 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.

  13. Picked this for a morning recommendation in our company chat, and a look at qorzino 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.

  14. Left me wanting to read more rather than feeling burned out, that is a good sign, and a look at urbanrivo confirmed there is plenty more here to explore, the kind of writing that builds appetite rather than killing it which is a rare quality on the modern open internet today across most categories of content.

  15. Reading this gave me a small sense of progress on a topic I have been slowly working through, and a stop at zulmora added another step forward, learning happens in small increments across many sources and finding sources that consistently contribute is the actual practical value of careful curation in an information rich world.

  16. Reading this prompted a small redirection in something I was working on, and a stop at hesyam extended that redirecting influence, content that affects my actual work rather than just my thinking has the highest practical impact and this site is providing that level of influence for me at a sustainable rate apparently.

  17. Reading this gave me confidence to make a decision I had been putting off, and a stop at xarvilo reinforced that confidence, content that translates into action in my own life rather than just informing it is content with the highest practical value and this site is generating that action level utility for me lately.

  18. Worth flagging that this approach to the topic is fresh without being contrarian, and a stop at zunkavi 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.

  19. Reading this gave me a small framework I expect to use going forward, and a stop at auralbrick extended that framework, content that produces transferable mental models rather than just specific facts is content with multiplicative value and this site is providing those models at a rate that justifies extra attention from me regularly.

  20. A small editorial detail caught my attention, the way headings related to body text, and a look at minutemotel maintained that careful relationship, structural details like that show up to readers who notice them and the writers here have clearly thought about every level of the piece rather than just the words.

  21. Now recognising the post as a rare example of careful writing on a topic that mostly receives careless treatment, and a stop at pebbleorbit extended that contrast with the average elsewhere, content that highlights how much the average is settling for low quality is content that has both internal merit and external value as a benchmark.

  22. A piece that prompted a small mental rearrangement of how I order related ideas, and a look at tirlumo extended that rearranging effect, content that affects the structure of my thinking rather than just adding to it is content with the deepest kind of impact and this site is reaching that depth for me today.

  23. Granted I am giving this site more credit than I usually give new finds, and a look at clockcard 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.

  24. Самара, всем привет Ситуация знакомая Рассол уже не лезет Короче, единственное что реально спасает — капельница от похмелья на дому срочно Поставили капельницу с солевым раствором В общем, жмите чтобы сохранить — капельница от запоя капельница от запоя Капельница — это быстро и эффективно Перешлите тем кто в такой же ситуации

  25. Just nice to read something that does not feel like it was assembled from a content brief, and a stop at hesyam 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.

Deixe um comentário

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