<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">legat de:<div><br></div><div>"</div><div><span class="Apple-style-span" style="color: rgb(99, 140, 156); font-family: Verdana, 'Lucida Grande', Lucida, Helvetica, Arial, sans-serif; font-weight: bold; line-height: 19px; background-color: rgb(255, 255, 255); "><div class="li" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: rgb(51, 51, 51); ">Se poate implementa un semafor folosind <strong style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">doar</strong> mutex-uri? Dar un mutex folosind <strong style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px;
margin-bottom: 0px; margin-left: 0px; ">doar</strong> semafoare?</div><ul style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 1.5em; line-height: 1.5em; list-style-type: square; list-style-image: none; color: rgb(99, 140, 156); "><li class="level1" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div class="li" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: rgb(51, 51, 51); "><strong style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Răspuns</strong>:</div><ul style="padding-top: 0px; padding-right: 0px;
padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 1.5em; line-height: 1.5em; list-style-type: square; list-style-image: none; color: rgb(99, 140, 156); "><li class="level2" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div class="li" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: rgb(51, 51, 51); ">Un mutex se poate implementa ca un semafor binar. Răspuns afirmativ la a doua întrebare.</div></li><li class="level2" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div class="li" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px;
padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: rgb(51, 51, 51); "><strong style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Nu</strong> se poate implementa un semafor folosind <strong style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">doar</strong> mutex-uri întrucât avem nevoie de un mecanism de notificare atomică împreună cu celelalte acțiuni. Presupunând că se folosește un contor, implementarea funcției <code style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 13px; ">down</code> va
fi:</div></li></ul></li></ul></span></div><div>"<br><br></div><div>Am o mica nedumerire:</div><div>facem o distinctie intre mutex si semafor binar? (adica ownership, numai threadul care a facut lock pe mutex poate sa faca unlock)</div><div><br></div><div>daca DA</div><div>atunci in primul raspuns ar trebui completat semaforul cu informatie despre cine a luat (ca doar threadID care a luat semaforul sa faca unlock)</div><div><br></div><div>daca NU</div><div>atunci un semanfor general poate fi implementat cu semafoare binare (2 sunt de ajuns) si un contor.</div><div><br>--- On <b>Fri, 9/16/11, so-request@cursuri.cs.pub.ro <i><so-request@cursuri.cs.pub.ro></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: so-request@cursuri.cs.pub.ro <so-request@cursuri.cs.pub.ro><br>Subject: so Digest, Vol 65, Issue 4<br>To: so@cursuri.cs.pub.ro<br>Date: Friday, September 16, 2011, 2:00
AM<br><br><div class="plainMail">Send so mailing list submissions to<br> <a ymailto="mailto:so@cursuri.cs.pub.ro" href="/mc/compose?to=so@cursuri.cs.pub.ro">so@cursuri.cs.pub.ro</a><br><br>To subscribe or unsubscribe via the World Wide Web, visit<br> <a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br>or, via email, send a message with subject or body 'help' to<br> <a ymailto="mailto:so-request@cursuri.cs.pub.ro" href="/mc/compose?to=so-request@cursuri.cs.pub.ro">so-request@cursuri.cs.pub.ro</a><br><br>You can reach the person managing the list at<br> <a ymailto="mailto:so-owner@cursuri.cs.pub.ro" href="/mc/compose?to=so-owner@cursuri.cs.pub.ro">so-owner@cursuri.cs.pub.ro</a><br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of so
digest..."<br><br><br>Today's Topics:<br><br> 1. Subiecte examen restanta/marire - septembrie 2011<br> (Razvan Deaconescu)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Fri, 16 Sep 2011 10:30:16 +0300<br>From: Razvan Deaconescu <<a ymailto="mailto:razvan.deaconescu@cs.pub.ro" href="/mc/compose?to=razvan.deaconescu@cs.pub.ro">razvan.deaconescu@cs.pub.ro</a>><br>Subject: [so] Subiecte examen restanta/marire - septembrie 2011<br>To: Student-SO Mailing List <<a ymailto="mailto:so@cursuri.cs.pub.ro" href="/mc/compose?to=so@cursuri.cs.pub.ro">so@cursuri.cs.pub.ro</a>><br>Message-ID: <<a ymailto="mailto:1316158216.2690.70.camel@einherjar.cs.pub.ro" href="/mc/compose?to=1316158216.2690.70.camel@einherjar.cs.pub.ro">1316158216.2690.70.camel@einherjar.cs.pub.ro</a>><br>Content-Type: text/plain; charset="UTF-8"<br><br>Salutare!<br><br>G?si?i pe
wiki[1] subiectele de la examenele de restan??/m?rire din<br>sesiunea septembrie 2011.<br><br>[1] <a href="http://elf.cs.pub.ro/so/wiki/examen#examen-restanta" target="_blank">http://elf.cs.pub.ro/so/wiki/examen#examen-restanta</a><br><br>R?zvan<br><br><br><br>------------------------------<br><br>_______________________________________________<br>so mailing list<br><a ymailto="mailto:so@cursuri.cs.pub.ro" href="/mc/compose?to=so@cursuri.cs.pub.ro">so@cursuri.cs.pub.ro</a><br><a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br><br><br>End of so Digest, Vol 65, Issue 4<br>*********************************<br></div></blockquote></div></td></tr></table>