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.

6.015 Comentários

  1. Came in tired from a long day and the writing held my attention anyway, and a stop at directionalclaritywins kept that going, content that can engage a fatigued reader is doing something right because most online reading happens in suboptimal conditions like that one and quality content adapts to it without complaint.

  2. Felt the post was written for someone like me without explicitly addressing me, and a look at cottonmeadowmarkethall produced the same fit, when content lands on its target without pandering you know the writer has done careful audience thinking rather than relying on demographic targeting or interest signals to do the work of editorial decisions.

  3. Now planning to recommend this site in a context where my recommendations are taken seriously, and a stop at tealcovecraftcollective confirmed I should make that recommendation soon, the small but real act of recommending content into spaces where my taste matters is something I take seriously and this site is worth the recommendation.

  4. Did not expect much when I clicked through but ended up reading the whole thing carefully, and a stop at skyharborcraftcollective kept that engagement going, sometimes the unassuming sites turn out to deliver more than the flashy ones which is something I have learned to look out for over time online lately and across topics.

  5. Reading this with my morning coffee turned into reading the related posts with my morning coffee, and a stop at etherfairs stretched the morning further, content that pulls breakfast into a reading session rather than just accompanying it is content that has earned a higher claim on my attention than the average article does.

  6. Reading this in three sittings because the day was fragmented, and the piece survived the fragmentation, and a stop at directionalclaritywins held up under similar reading conditions, content engineered for continuous attention is fragile in modern conditions and this site reads as durable across the realistic ways people consume content today.

  7. Took the time to read the comments on this post too and they were also worth reading, and a stop at meadowharborvendorhall suggested the community quality matches the content quality, when the conversation around a piece is as good as the piece itself you know you have found a real corner of the internet.

  8. Came in confused about the topic and left with a much firmer grasp on it, and after skyharborcraftcollective I felt I could explain this to someone else without hesitation, that is the gold standard for any educational content and most sites simply fail to reach it ever which is unfortunate but true.

  9. Now feeling the quiet pleasure of finding writing that takes itself seriously without being self serious, and a stop at brightharborvendorhall extended that subtle pleasure, the gap between earnest and pretentious is fine and this site has clearly chosen to land on the earnest side without slipping over into pretentious which is impressive.

  10. Alright listen up because I’m about to save you a massive headache. 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, do some real digging first and read actual customer reviews. Miami without a decent whip is basically a punishment, whether you are doing Coral Gables brunch, South Beach night run, or a spontaneous Everglades detour.

    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: mercedes g wagon rental near me mercedes g wagon rental near me. Yeah, parking in Brickell will cost you a small mortgage — but that’s city life. Anyway, at least there’s one honest rental joint left in this town, hope this helps some of you save a few bucks.

  11. Started reading without much expectation and ended on a high note, and a look at stylishbuycorner continued that arc, content that builds rather than peaks early is a sign of a writer who knows how to structure a piece for sustained reader engagement rather than relying on a strong hook to do all the work.

  12. Took something from this I did not expect to find, and a stop at levqino added another unexpected useful piece, content that exceeds expectations rather than just meeting them is the kind that builds enthusiasm and earns repeat visits without any explicit ask from the writer or platform behind the work being read.

  13. UpvoteRocket delivers anonymous automated votes to 25+ game server toplists XtremeTop100, GTop100, TopG, MMtop200, RagnaTOP, MuTop100 and more. Undetectable, no bans, no risk. Pay only per successful vote delivered. Launch a campaign in seconds and rank higher today.

  14. A genuine compliment to the writer for keeping the post focused on what mattered, and a look at coastharborvendorhall continued that disciplined focus, focus is a editorial choice that compounds across many small decisions and this site has clearly made those small decisions consistently across what I have read so far this week here.

  15. Came away with a small but real shift in perspective on the topic, and a stop at stylishbuycorner pushed that shift a bit further, the kind of subtle reframing that good writing does to a reader without making a big deal of it is something I always appreciate when it happens which is sadly not that often.

Deixe um comentário

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