[so] so Digest, Vol 65, Issue 7

Razvan Pistolea razvy000 at yahoo.com
Tue Sep 20 12:19:09 EEST 2011


Cu placere,
Razvan

--- On Tue, 9/20/11, so-request at cursuri.cs.pub.ro <so-request at cursuri.cs.pub.ro> wrote:

From: so-request at cursuri.cs.pub.ro <so-request at cursuri.cs.pub.ro>
Subject: so Digest, Vol 65, Issue 7
To: so at cursuri.cs.pub.ro
Date: Tuesday, September 20, 2011, 2:00 AM

Send so mailing list submissions to
    so at cursuri.cs.pub.ro

To subscribe or unsubscribe via the World Wide Web, visit
    http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so
or, via email, send a message with subject or body 'help' to
    so-request at cursuri.cs.pub.ro

You can reach the person managing the list at
    so-owner at cursuri.cs.pub.ro

When replying, please edit your Subject line so it is more specific
than "Re: Contents of so digest..."


Today's Topics:

   1. Re: so Digest, Vol 65, Issue 5 (Razvan Deaconescu)


----------------------------------------------------------------------

Message: 1
Date: Sat, 17 Sep 2011 17:17:26 +0300
From: Razvan Deaconescu <razvan.deaconescu at cs.pub.ro>
Subject: Re: [so] so Digest, Vol 65, Issue 5
To: Sisteme de Operare <so at cursuri.cs.pub.ro>
Message-ID: <1316269047.5336.20.camel at einherjar.cs.pub.ro>
Content-Type: text/plain; charset="UTF-8"

On Sat, 2011-09-17 at 04:20 -0700, Razvan Pistolea wrote:
> SemaforGeneral(N){
> 
>     c = N                        // contor; lasa maxim N
>     mutex = SemaforBinar(1)        // protejeaza contorul
>     s2 = SemaforBinar(N>1?1:0)    // implementeaza "notificarea"
>     
>     wait()
>         s2.wait()
>         mutex.wait()
>         c--
>         if c > 0
>             s2.release()
>         mutex.release()
>         
>     release()
>         mutex.wait()
>         c++
>         if c == 1
>             s2.release()
>         mutex.release()
> }

Da, a?a este. Mul?umim de observa?ie.

Am g?sit ?i pe Google[1]. Am actualizat rezolvarea[2].

[1] http://webhome.csc.uvic.ca/~mcheng/460/notes/gensem.pdf
[2] http://elf.cs.pub.ro/so/wiki/examen#lucrare-2

R?zvan



------------------------------

_______________________________________________
so mailing list
so at cursuri.cs.pub.ro
http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so


End of so Digest, Vol 65, Issue 7
*********************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/so/attachments/20110920/40c0f41c/attachment.html>


More information about the so mailing list