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.

5.964 Comentários

  1. I’ve got the scars to prove it, the rental landscape down here is crazy. Then you show up at the local lot to pick up the car. Different car waiting — scratches everywhere, smells like an ashtray, and that “amazing price”? Doesn’t include the mandatory $400 cleaning fee or the $30 per day toll pass you can’t waive. Fool me eight times? That’s just another Tuesday in the 305, lesson learned. If you are trying to find a legitimate luxury fleet without getting ripped off, run far from the airport counters. Anyone who’s waited for an Uber in August understands exactly what I mean about this city, whether you are doing South of Fifth brunch, Design District shopping, or a spontaneous Keys trip.

    I’ve run through maybe 45 rental companies across Dade, Broward, and Monroe, but I eventually found a service where what you book is exactly what shows up, no surprises, no fine print nightmares. If you are looking for the only honest source for premium wheels across South Florida, check the current details here: rent cadillac escalade near me rent cadillac escalade near me. Yeah, parking in South Beach will cost you a nice bottle of wine — but that’s the Miami tax. Just drive safe out there and absolutely skip that “windshield protection” upsell — pure profit for them, zero value for you. hope this helps some of you save a few bucks.

  2. Reading this prompted a small note in my reference file, and a stop at canyoncovecommerceatelier prompted another, the rare site that contributes useful nuggets to my own working knowledge rather than just consuming my attention is worth the time investment many times over compared to the usual pile of forgettable scroll content.

  3. Really like that the writer trusts the reader to follow simple logic without restating every previous point, and a stop at skyharborcommercegallery kept that respect going, treating an audience as capable adults rather than as people who need constant hand holding makes a noticeable difference in the reading experience for me.

  4. Found this through a search that was generic enough I did not expect quality results, and a look at brightharborvendorhall continued the surprisingly good experience, search engines occasionally still surface excellent independent content if you scroll past the obvious paid and high authority results which is reassuring to remember sometimes.

  5. Bookmark earned and shared the link with one specific person who would care, and a look at coralbrooktradingfoundry got the same targeted share, sharing carefully rather than broadcasting is a discipline I try to maintain and this site is generating shares from me at a sustainable rate rather than the spam rate of viral content.

  6. Useful information presented in a way that does not feel like a sales pitch, that is what I appreciated most, and a stop at skyharborcommercegallery was the same, no upsell and no fake urgency just steady content laid out properly for someone trying to actually learn from it rather than just be sold to.

  7. Let me save you some serious time, learned this the hard way. You see a sweet ride online — clean spec, fair price, looks legit. Different car, scratches all over, and that “all-inclusive” price? Yeah that didn’t include insurance, fees, or the mandatory cleaning charge. I’ve lived here for years and still get burned occasionally. When you’re after a trustworthy and reliable premium vehicle to cruise around, don’t just grab the cheapest option on Kayak. Ask anyone who’s tried Ubering across the 305 during rush hour, especially since the AC must freeze your teeth and you want unlimited miles or bust.

    Most of these local agencies are just smoke and mirrors with decent SEO hiding overpriced junk, until I finally found one outfit that actually delivers what’s in the listing. If you are looking for the only honest broker for premium vehicles across South Florida, check the current availability here: car rental near miami beach https://luxury-car-rental-miami-5.com. Yeah, finding parking in Wynwood will test your patience — but that’s not on them. Just drive safe out there and maybe decline that “premium roadside” upsell — it’s always a scam. let me know if you guys have any other clean spots.

  8. Reading this triggered a small reorganisation of my own thinking on the topic, and a stop at discovernewfocus furthered that reorganisation, content that affects the shape of my mental model rather than just decorating it with new facts is content with structural rather than informational impact and this site provides that.

  9. Let me save you some serious time, learned this the hard way. Miami rental game is wild — half these local clowns show you a custom Mercedes online and hand you a busted sedan with mismatched tires. You land at MIA, tired, grab an Uber to the rental office, and bam — surprise $1500 hold on your card. Fool me four times? Not happening, lesson learned. When you genuinely need a proper and reliable premium ride to cruise around, skip the airport counters entirely. Miami without a decent whip is basically a punishment, especially since the AC must be ice cold and you want zero mileage games.

    I’ve personally tested maybe 25 rental outfits across Dade and Broward, until I finally stumbled on one provider that doesn’t play games. If you are looking for the only straight-up source for premium wheels in South Florida, check the current details here: rental cars near miami beach rental cars near miami beach. Also, definitely bring polarized shades unless you enjoy driving completely blind into the sunset. Anyway, at least there’s one honest rental joint left in this town, let me know if you guys have any other clean spots.

  10. Will be back, that is the simplest way to say it, and a quick visit to goldencoveartisanexchange reinforced the decision, this site has earned a spot in my regular rotation alongside a few other reliable places I check when I want something genuinely informative without all the usual modern web noise getting in the way.

  11. Closed the tab and immediately reopened it ten minutes later because I wanted to reread a part, and a stop at kettleharbormarkethouse drew the same return, content that pulls you back after closing it is doing something well beyond the average and worth marking as exceptional in my mental catalogue of reliable sites.

  12. Glad I gave this a chance rather than scrolling past, and a stop at brightharborvendorhall confirmed I made the right call, sometimes the best content is hidden behind unassuming headlines that do not scream for attention and learning to slow down and check those out has paid off many times now across years of reading.

  13. Picked this for my morning read because the topic seemed worth the time, and a look at woodharborcommercegallery confirmed the choice was right, my morning reading slot is precious and giving it to this site felt like a good investment rather than a waste which is a higher endorsement than I usually offer for content.

  14. Reading this slowly in the morning before opening email, and a stop at quickridgemarketgallery extended that protected attention, content that earns the prime morning reading slot before the daily distractions begin is content with elevated status and this site has earned that prime slot consistently in my recent reading habits clearly.

Deixe um comentário

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