<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Cu placere,<div><br><div>Razvan<br><br>--- On <b>Tue, 9/20/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 7<br>To: so@cursuri.cs.pub.ro<br>Date: Tuesday, September 20, 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. Re: so Digest, Vol 65, Issue 5 (Razvan Deaconescu)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Sat, 17 Sep 2011 17:17:26 +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: Re: [so] so Digest,
Vol 65, Issue 5<br>To: Sisteme de Operare <<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:1316269047.5336.20.camel@einherjar.cs.pub.ro" href="/mc/compose?to=1316269047.5336.20.camel@einherjar.cs.pub.ro">1316269047.5336.20.camel@einherjar.cs.pub.ro</a>><br>Content-Type: text/plain; charset="UTF-8"<br><br>On Sat, 2011-09-17 at 04:20 -0700, Razvan Pistolea wrote:<br>> SemaforGeneral(N){<br>> <br>> c = N // contor; lasa maxim N<br>> mutex = SemaforBinar(1) // protejeaza contorul<br>> s2 = SemaforBinar(N>1?1:0) // implementeaza "notificarea"<br>> <br>> wait()<br>>
s2.wait()<br>> mutex.wait()<br>> c--<br>> if c > 0<br>> s2.release()<br>> mutex.release()<br>> <br>> release()<br>> mutex.wait()<br>> c++<br>> if c == 1<br>> s2.release()<br>> mutex.release()<br>> }<br><br>Da, a?a este. Mul?umim de observa?ie.<br><br>Am g?sit ?i pe Google[1]. Am actualizat rezolvarea[2].<br><br>[1] <a href="http://webhome.csc.uvic.ca/~mcheng/460/notes/gensem.pdf"
target="_blank">http://webhome.csc.uvic.ca/~mcheng/460/notes/gensem.pdf</a><br>[2] <a href="http://elf.cs.pub.ro/so/wiki/examen#lucrare-2" target="_blank">http://elf.cs.pub.ro/so/wiki/examen#lucrare-2</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 7<br>*********************************<br></div></blockquote></div></div></td></tr></table>