Ir ao conteúdo

Exercicio 3 – Sistemas Operacionais II – INE5424 – UFSC

Trabalho 3 – EPOS
System Object Destruction

    No exercício três deviamos implementar o controle de destrução de objetos, o qual não deve corromper o sistema e também deve estar de acordo com a semântica da linguagem de programação.
    A implementação adotada funciona da seguinte maneira: na class Thread foi adicionado um campo _container, nele é guardada a fila em que a Thread se encontra no momento. Os métodos desta classe foram alterados para que a consistência do campo _container seja mantida. No método join, por exemplo, o campo _container é atualizado com o endereço da fila _waiting_for_me do objeto em que se da join.
    Quando uma thread entra para o estado RUNNING o seu campo container não é atualizado, já que caso o mesmo seja deletado (ou auto-deletado), ele tentará se remover de uma fila em que não está, não causando mais problemas.
    Quando uma thread que possui elementos na sua fila _waiting_for_me é deletada, ela não acorda aquelas que a estão esperando, entrando em uma situação de deadlock. Nosso sistema, por conseguir detectar essa situação facilmente, gera um aviso. Porém, caso a Thread que tente se dar join já tiver sido destruída e removida da memória, a thread em execução trava, como nosso sistema não consegue detectar esse erro ele não é informado.
    Quando um objeto que extende a classe Synchronizer é deletado, seu destrutor chama wakeup_all, fazendo com que todos as threads que estiverem travadas nele continuem a execução.

Arquivos Modificados:
Thread.h
Thread.cc
Sycronizer.h

1.232 Comentários

  1. Hi there, of course this post is genuinely good and I have learned lot of things from it on the topic of blogging. thanks.

  2. What’s up it’s me, I am also visiting this website regularly, this website is truly nice and the users are really sharing pleasant thoughts.

  3. It’s really very complicated in this busy life to listen news on TV, therefore I simply use internet for that reason, and obtain the most recent information.

  4. Hey there! I just wanted to ask if you ever have any trouble with hackers? My last blog (wordpress) was hacked and I ended up losing months of hard work due to no back up. Do you have any solutions to protect against hackers?

  5. Roberthag Roberthag

    Do you trade cryptocurrencies? bitkelt trade official site automate your transactions and earn passive income. Smart algorithms analyze the market and help you make decisions. Increase your income and reduce risks with modern technology.

  6. Капельница от похмелья в Нижнем Новгороде: снятие симптомов похмелья, восстановление и поддержка под наблюдением врачей в наркологической клинике «Похмельная служба»
    Подробнее можно узнать тут – https://kapelnicza-ot-pokhmelya-nizhnij-novgorod-2.ru

  7. JosephHoany JosephHoany

    Как отмечает ведущий научный сотрудник ФГБУН «НМИЦ психиатрии и наркологии» Минздрава России, наличие междисциплинарной команды — один из основных факторов, определяющих успех терапии при зависимости.
    Подробнее тут – наркологическое лечение наркомания в мурманске

  8. gquhqkjzy gquhqkjzy

    Before you play roulette online UK, keep in mind that this version features two zero pockets (0 and 00) and traditional numbers 1 to 36. Therefore, the game comes with a lower RTP of around 94.74%. Some types of American roulette provide the Surrender rule. If you make an even-money stake but the ball lands on 0 or 00, you lose only 50% of your original wager, as with La Partage in French variation. Super Stake Blackjack is straightforward to play as Stakelog has developed the game to play to perfect Blackjack Strategy. Decision-making has been taken out of the player’s hands, with the dealer performing actions automatically. Players located in the United States, excluding the state of Washington are eligible to use Fliff. Players in the states of Hawaii, Idaho, Louisiana, Nevada, and Tennessee may use the platform but are restricted from participating in our promotional games. Eligibility to participate in promotions in other states may vary month-to-month. For more information on eligibility and availability please see our Terms of Use and Sweepstakes Rules.
    https://absi.shelter-technology.com/how-to-easily-access-stake-in-australia-for-casino-enthusiasts/
    Amatic Industries has kept the Lucky Joker 10 Cash Spins slot machine simple, which we think is perfect for players who don’t like many bells and whistles. The game has 10 fixed paylines, low volatility, and 97.12% RTP. Increase your chances to win with wilds and land COIN symbols to trigger the Cash Spin Feature. Slot machines often display a series of spins where players appear to be only one symbol away from a win, leading them to believe that they almost won falsely. Slot games do not work cyclically, and slot machine jackpots don’t become due. Legacy of Dead is an online slot developed by Play’n GO. It’s yet another “Book” game. The slot has 5 reels, 3 rows, and 10 fixed pay lines. This penny slot offers higher win potential even with the smallest 1p bets. Spin the legendary big wheel for iconic prizes and classic excitement in this fan-favorite slot sensation!

  9. Hmm it looks like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well am an aspiring blog blogger but I’m still new to the whole thing. Do you have any suggestions for rookie blog writers? I’d definitely appreciate it.

  10. Danielgom Danielgom

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

  11. Bobbyoblic Bobbyoblic

    Нарколог на дом — это удобное и эффективное решение для тех, кто сталкивается с тяжелыми последствиями запоя или алкогольной интоксикации. В наркологической клинике «Частный медик 24» в Самаре мы предоставляем круглосуточную помощь, выезд нарколога и лечение на дому. Это позволяет пациентам получить профессиональную медицинскую помощь в удобной и знакомой обстановке, что особенно важно, когда состояние человека ухудшается после длительного употребления алкоголя или наркотиков.
    Детальнее – нарколог на дом самара

  12. After checking out a number of the articles on your website, I really like your technique of blogging. I saved as a favorite it to my bookmark webpage list and will be checking back in the near future. Please check out my website as well and let me know what you think.

  13. Williamtet Williamtet

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

  14. RichardFus RichardFus

    Нарколог на дом — это формат срочной медицинской помощи, при котором врач приезжает к пациенту, проводит осмотр, оценивает риски, запускает первичную терапию и принимает решение, можно ли безопасно стабилизировать состояние дома или требуется перевод в стационар. Такой выезд особенно важен тогда, когда человеку тяжело ехать самостоятельно: выраженная слабость, тремор, тошнота, скачки давления, тревога, бессонница, повторный приём алкоголя для «облегчения» и нарастающее ухудшение самочувствия. Домашний формат ценят не только за удобство. Его задача — быстро сократить промежуток между ухудшением состояния и началом лечения. Чем раньше врач увидит пациента, тем проще остановить развитие осложнений, собрать понятный план действий на ближайшие часы и не допустить ошибок самолечения.
    Получить дополнительную информацию – narkolog-na-dom-voronezh.ru/

  15. Wayneboymn Wayneboymn

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

Deixe um comentário

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