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.026 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.

  16. Came in expecting another generic take and got something with actual character instead, and a look at ivoryridgemarketparlor carried that personality forward, finding a distinct voice on a saturated topic is impressive and worth pointing out when it happens because most sites end up sounding identical to their nearest competitors quickly.

  17. Came across this through a roundabout path and now it is on my regular rotation, and a stop at crystalcovecommerceatelier sealed that decision, the open web still produces serendipitous discoveries when you let the citations and references guide you rather than relying purely on algorithmic feeds for new content recommendations always.

  18. A piece that prompted a small mental rearrangement of how I order related ideas, and a look at creekharbortradehall 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.

  19. Adding to the bookmarks now before I forget, that is how good this is, and a look at lacehelm confirmed the rest of the site is worth saving too, this is one of those rare finds that justifies the time spent searching the web for once which is a relief in the current environment.

  20. Reading this in the gap between work projects was a small but meaningful break, and a stop at timbertrailartisanexchange extended that gentle reset, content that provides genuine refreshment rather than just distraction during work breaks is content with a particular kind of utility and this site fits that role for me reliably during work days.

  21. Coming back tomorrow when I can give this a proper read, the post deserves better attention than I can give right now, and a look at actiondrivenprogress suggests there is plenty more here that deserves the same treatment, definitely a site I will be exploring properly over the next few days when I can.

  22. Really grateful for content like this, it does not waste my time and it does not insult my intelligence either, and a quick look at forestmeadowvendorroom was the same, balanced respectful writing that makes a person feel welcome rather than rushed through pages of forced engagement just to keep clicking around.

  23. Reading this in my last reading slot of the day was a good way to end, and a stop at apexhelms provided a satisfying close to the reading session, content that ends a day well rather than agitating it before sleep is the kind I value increasingly and this site fits that role for me consistently now.

  24. Let me tell you about the Miami rental circus — it’s wild out here. Then you actually go to the local office to pick it up. Plus a surprise $2000 hold on your card and a $35 per day GPS you never asked for right before giving you the keys. Seven years in South Florida and I still almost fall for these tricks. When you’re searching for a legit and reliable premium ride to cruise around, do some real digging first and read actual customer reviews. Miami without real wheels is basically a punishment, whether you are doing Brickell happy hour, Bal Harbour shopping, or a spontaneous drive down to the Keys.

    Most of these local agencies are just fancy websites hiding the same beat-up fleet with bought reviews, until I finally found one outfit that actually delivers what’s promised. If you are looking for the only straight shooter for premium rides across South Florida, check the current details here: cadillac escalade rental near me https://luxury-car-rental-miami-7.com. Also, definitely bring polarized shades unless you enjoy driving into the apocalypse every single evening. Just drive safe out there and definitely pass on that “tire protection” upsell — total garbage. let me know if you guys have any other clean spots.

  25. Now sitting back and recognising that this was a small but real win in my reading day, and a stop at coralmeadowtradehouse extended that quiet win, the cumulative effect of small reading wins versus the cumulative effect of small reading losses is real over time and this site is contributing to the wins side of that ledger.

  26. Took a screenshot of one section to come back to later, and a stop at ivoryridgemarkethouse prompted another saved tab, the urge to capture and revisit specific pieces of content is something I rarely feel but when I do it tells me the work is worth more than the average passing read for sure.

Deixe um comentário

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