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.134 Comentários

  1. Liked the careful word choice throughout, every term seemed picked for a reason rather than thrown in casually, and a stop at flintmeadowmarketparlor continued that precise style, this kind of attention to small details is what separates careful writing from the usual rushed content that dominates blog spaces today across pretty much every topic I follow.

  2. Really appreciate this kind of writing, no shouting and no clickbait headlines just steady useful content, and a quick look at amberridgevendorlounge kept that going, definitely a site I will be returning to whenever I need a sensible take on similar topics in the days ahead and also during slower work weeks.

  3. Trust me, I’ve learned everything the hard way so you don’t have to. Then you actually show up to the local office to grab the keys. Plus they put a surprise $4000 hold on your card and say it’ll take two weeks to release right before giving you the keys. Eleven years in South Florida and these clowns still almost get me. If you are trying to find a legitimate luxury fleet without getting ripped off, avoid the airport like the plague. Miami without proper wheels is basically a disaster, whether you are doing Key Biscayne sunset, Design District shopping, or a spontaneous drive down to the Everglades.

    I’ve tested maybe 60 rental companies across Dade, Broward, and Collier, until I finally found one outfit that actually delivers what’s in the photos. If you are looking for the only honest source for premium rides across South Florida, check the current details here: rent a porsche near me https://luxury-car-rental-miami-11.com. Yeah, parking in South Beach will cost you a nice bottle of champagne — but that’s the Miami tax. Just drive safe out there and definitely skip that “tire and wheel” upsell — pure profit for them, zero value for you. let me know if you guys have any other clean spots.

  4. Worth recognising that this site does not chase the daily news cycle, and a stop at chestnutharborvendorstudio confirmed the longer publication arc, sites that resist the pressure to comment on every passing event are sites with genuine editorial discipline and this one has clearly chosen depth over volume which I respect deeply.

  5. 1xbet indir nasıl yapılır diye çok araştırdım valla. Apk’yı nereden indireceğimi bilemedim bir türlü. Güncel bilgileri kontrol edip süreci hatasız başlattım. En sonunda sağlam bir kaynağa ulaştım ve size de tüm detayları aktarmak istedim, güncel bilgilere buradan bakabilirsiniz: 1xbet mobii 1xbet mobii. Şimdi size kısaca özet geçeyim — mobil uygulaması gerçekten akıcı çalışıyor.

    güncellemeleri de düzenli geliyor. İşin doğrusunu söylemek gerekirse — kesinlikle pişman olmazsınız deneyin derim. Herkese hayırlı olsun…

  6. If I were to recommend a starting point for the topic this site would be near the top of my list, and a stop at flintmeadowmarketparlor reinforced that recommendation status, the small list of starting point recommendations I keep for friends asking about topics is short and this site is now firmly on it.

  7. Honest reaction is that this is the kind of writing I would defend in a conversation about good blog content, and a look at premiumcartarena reinforced that, the rare site whose work I would actively recommend rather than just tolerate is the kind I want to support through return visits regularly.

  8. My reading list is short and selective and this site is now on it, and a stop at uplandcovevendorparlor confirmed the placement, the short list of sites I read deliberately rather than encounter accidentally is something I curate carefully and adding to it is a real act of trust which this site has earned today.

  9. Picked this for a morning recommendation in our company chat, and a look at amberridgevendorlounge suggested I will mention this site again later, recommending content into a workplace context is a small editorial act that requires confidence in the recommendation and this site is making me confident in those recommendations consistently here too.

  10. Most of the time I feel the open web is in decline and then I find a site like this, and a stop at jasperharbortradehall reinforced that mood lift, the cumulative effect of finding occasional excellent independent content versus the cumulative effect of finding mostly mediocre content is real for the long term reader maintaining web habits today.

  11. Took a chance on the headline and was rewarded, and a stop at coralharborartisanexchange kept the rewards coming as I clicked through, the kind of place where every link leads somewhere worth the click is a small luxury on the modern web where so many sites are mostly empty calories disguised as content.

  12. Without overstating it this is a quietly excellent post, and a look at amberridgecommercegallery extended that quiet excellence, content that earns superlatives without demanding them through marketing language is content that has truly earned them through the substance and this site has clearly produced work in that earned excellence category today.

  13. Reading this slowly to give it the attention it deserved, and a stop at chestnutharborvendorstudio earned the same slow read, choosing to read slowly is a small act of respect for content quality and very few sites earn that respect from me but this one did so without any explicit ask which is the cleanest way.

  14. A piece that earned its conclusions through the body rather than asserting them at the end, and a look at emberstonevendorlounge maintained the same earned quality, conclusions that follow from what came before are more persuasive than declarations and this site has clearly internalised that principle in how it constructs arguments throughout pieces.

  15. Glad I stumbled across this post, the explanations actually make sense without needing background knowledge to follow along, and after a stop at lakequill the same was true there, no assumptions about the reader just clear writing that anyone can understand from the first line right through to the end.

  16. A well calibrated piece that knew its scope and stayed inside it, and a look at premiumcartarena maintained the same scope discipline, scope creep is one of the failure modes of long blog posts and this site has clearly invested in the editorial discipline to prevent it which shows up in tightly contained pieces.

  17. Bookmark earned and shared the link with one specific person who would care, and a look at uplandcovevendorparlor 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.

  18. Really appreciate the confidence to make a clear point rather than hedging everything, and a quick visit to silverharborvendorhall maintained the same direct stance, writing that takes positions rather than equivocating is more useful even when the positions are debatable because at least the reader has something to react to clearly.

  19. Felt the post had been quietly polished rather than aggressively styled, and a look at timbertrailcraftcollective confirmed the same understated polish, sites whose quality reveals itself slowly rather than announcing itself loudly are the kind I trust more deeply because the trust is not based on first impressions of marketing but actual substance.

  20. Excellent execution from start to finish, the post never loses its rhythm and the points stay sharp, and a quick stop at crystalharborvendorhall kept the same level going, consistency like this across a site is the marker of a serious operation rather than a casual side project running on autopilot somewhere else.

  21. Now appreciating that the post left me with enough to say in a follow up conversation, and a look at moveintoprogress added more material for those follow ups, content that prepares me for related conversations rather than just informing me alone is content with social utility and this site provides that social armament reliably for me.

  22. Skipped the comments section but might come back to read it, and a stop at progressthroughfocus hinted at a quality reader community, sites where the comments are worth reading separately from the post are increasingly rare and signal a particular kind of audience that has grown around the editorial vision over time gradually.

  23. Everything is very open with a very clear explanation of the
    issues. It was truly informative. Your website is extremely helpful.

    Thank you for sharing!

  24. The conclusions felt earned rather than tacked on at the end like an afterthought, and a look at coralharborartisanexchange kept that careful structure going, you can tell when a writer has thought about the shape of their post versus just letting it ramble out and hoping for the best at the end which most do.

  25. Reading this in the morning set a good tone for the day, and a quick visit to progressbuiltintentionally kept that good tone going, content can do that sometimes when it hits the right notes and finding sites that consistently strike that tone is something I have learned to recognise and reward with regular visits.

  26. Cuts through the usual marketing fluff that dominates this topic online, and a stop at silverharborvendorhall kept the same clean approach going, this is the kind of writing that respects the reader’s time rather than wasting it on repetitive setups before finally getting to the point at hand which is what most sites do.

  27. Honestly this hits the sweet spot between detail and brevity, no rambling and no shortcuts, and a quick visit to floraridgevendorroom kept that going across the related pages, the kind of place that respects your attention without trying to grab it through cheap tactics or attention seeking design choices that get tired fast.

  28. Found the use of subheadings really helpful for scanning back through the post later, and a stop at easyshopgoods kept that reader friendly approach going, navigation is something many blog writers ignore but small structural choices make a noticeable difference for someone returning to find a specific point again days or weeks later.

  29. Got pulled in by the headline and stayed because the content actually delivered on the promise, and a stop at shopgridmarket kept that trust intact, when a site lives up to its own framing it earns the right to keep showing up in my browser tabs going forward indefinitely from here on out really.

  30. Felt the post handled a sensitive angle of the topic with appropriate care, and a look at emberstonevendorlounge extended that careful handling across related material, sites that can navigate delicate territory without causing damage are rare and require a level of judgement that comes from experience rather than from following any clear playbook.

  31. Skipped past the first paragraph thinking it was setup and had to come back when the rest referenced it, and a stop at progressthroughfocus similarly rewarded careful reading from the start, content where every paragraph carries weight is content I now know to read from the beginning rather than skipping ahead.

  32. Reading this felt easy in the best way, no friction and no confusion at any point, and a stop at moveintoprogress carried that same comfort across more pages, the kind of editorial flow that lets you absorb information without fighting the format which is increasingly hard to find on the open web today across topics.

  33. Felt the post handled a sensitive angle of the topic with appropriate care, and a look at curiopact extended that careful handling across related material, sites that can navigate delicate territory without causing damage are rare and require a level of judgement that comes from experience rather than from following any clear playbook.

  34. Skipped the social share buttons but might come back to actually use one later, and a stop at buyloopshop extended that share urge, content that triggers genuine sharing impulses rather than performative ones is content that has actually moved me and not many posts in a typical week do that for me actually.

Deixe um comentário

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