Ir ao conteúdo

Exercicio 2 – Sistemas Operacionais II – INE5424 – UFSC

Trabalho 2 – EPOS
Implementação de Idle-waiting

    A implementação do exercicio 2, consiste em alteração da classe Syncronizer, onde na versão inicial a mesma utiliza yield gerando uma carga desnecessária para o processador. A alteração deve ser semelhante a realizada no exercicio um, fazendo com que não seja gasto recursos sem necessidade.
    Durante as discussões sobre a implementação imaginamos uma nova váriavel dentro de cada Thread para monitorar se a mesma está em uma estrutura como Semaphoro, Mutex ou váriavel condicional. Assim sendo possivel a verificação se está ou não, permitindo que nós façamos as devidas verificações para que o método resume e suspend não possam ser chamados quando a mesma estivesse esperando. Após algum tempo discutindo e analise dos códigos foi imaginada uma abordagem que em vez de criar uma váriavel nova para cada Thread seria necessário simplesmente a criação de um novo estado, denominado por nós de WAITING. Junto a isso foi criada uma fila para cada “Synchronizer”, que possui os processos que estão esperando para serem acordados. Os métodos que acordam os outros processos (wakeup e wakeup_all) foram implementados de forma não bloqueante, ou seja, as threads acordadas são apenas colocadas na fila “_ready”, sem troca imediata de contexto.
    Outras alterações também foram realizadas nos arquivos synchronizer.h, thread.cc, condition.h e semaphore.h, para que os mesmos funcionem corretamente com o novo estado WAITING. Por exemplo, no arquivo Thread.cc as implementações de Join, Resume e exit foram alteradas para a utilização deste novo estado, neste arquivo também foram criados novos métodos denominados sleep e wakeup. Que basicamente tratam a parte de colocar para dormir e botar neste novo estado e também na fila do “Synchronizer”. As devidas alterações foram realizadas nos demais arquivos, para que os mesmos funcionem com o novo estado WAITING.
    Também implementamos o busy waiting no “Synchronizer”, para o usuário poder escolher entre busy e idle waiting alterando uma variável booleana.

Arquivos Modificados:
synchronizer
condition.h
semaphore
thread

16.356 Comentários

  1. spinner_iusi spinner_iusi

    Long time lurker here, but I figured I would share how I pick an online casino these days. After a few bad experiences I learned to read the small print first.

    First thing is the licence: find the licence number and look it up, because some sites quietly block certain regions. Next come deposits and withdrawals: I want at least one fast e-wallet option, and cashout times should be listed up front.

    Never judge a site by the bonus alone. Read the wagering and the max bet rule, and some games count less towards it. A decent independent write-up with the current terms is here Gamblezen so you know what you are signing up for.

    I play almost only on my phone, so I check how the lobby works on a small screen. Ask support one simple question first: a real human reply beats a bot loop.

    That is about it. Treat it as entertainment, not income.

  2. highroll_lgEl highroll_lgEl

    Mostly a reader, rarely post, so here is how I pick an online casino these days. After getting burned once or twice I stopped going by ads alone.

    I always start with licensing: see which authority is listed in the footer, and if your country is on the allowed list. Next come deposits and withdrawals: crypto is a plus but not a must, and there should be no weird fees on cashouts.

    The welcome offer is where most people get caught. Anything above 40x rollover is a red flag for me, and the bonus usually expires in a week or two. A good recent review that covers all of this can be found here Smash Casino before you deposit anything.

    Most of my sessions are on mobile, and if there is an app I make sure it comes from the official page. Support matters too: slow or scripted answers usually mean trouble later.

    Anyway, that is my routine. Only play with money you can afford to lose.

  3. Michaeldiz Michaeldiz

    Капельница на дому подбирается на основе показаний, а не рекламного названия комплекса. Популярные витаминные комплексы подходят не каждому. Определение состава требует учитывать анализ, лекарства и реакции организма. Такой подход минимизирует риск нежелательных эффектов и помогает подобрать качественную медицинскую поддержку.
    Изучить вопрос подробнее – skolko-stoit-kapelnica-ot-alkogolya-na-domu

  4. Kevinlef Kevinlef

    Эта статья освещает различные аспекты освобождения от зависимости и пути к выздоровлению. Мы обсуждаем важность осознания своей проблемы и обращения за помощью. Читатели получат практические советы о том, как преодолевать трудности и строить новую жизнь без зависимости.
    Уникальные данные только сегодня – наркологическая помощь в Новом Уренгое

  5. lucky_ywst lucky_ywst

    Mostly a reader, rarely post, thought I would drop what I look at before signing up anywhere. After a few bad experiences I stopped going by ads alone.

    Licence comes first for me: see which authority is listed in the footer, and if your country is on the allowed list. After that I look at banking: I want at least one fast e-wallet option, and cashout times should be listed up front.

    Bonuses are the tricky part. Read the wagering and the max bet rule, and some games count less towards it. A good recent review that covers all of this is worth a read here Lottoland and it saved me some time.

    Most of my sessions are on mobile, so I check how the lobby works on a small screen. Support matters too: a real human reply beats a bot loop.

    That is about it. Set a budget and stick to it.

Deixe um comentário

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