This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Semaphores in libc


On Thu, Dec 31, 2009 at 3:33 PM, Luciano Rocha <strange@nsk.no-ip.org> wrote:
> On Thu, Dec 31, 2009 at 02:57:51PM +0000, Paulo J. Matos wrote:
>> Either I misunderstood your suggestions or the server I am running
>> this in is not behaving as it should:
>
> You didn't, it's all as I said. What is the server you're running this
> on?
>
>>
>> I compiled this file and I ran it under two Putty terminals. In both
>> of them, I see "Printing..." at the same time meaning they are both in
>> the critical region. :-/
>> Don't you see the same thing?
>
> No, the second instance I start gets locked out while the first is in
> "Printing..." state. I didn't wait for that one to finish, as I don't
> have enough disk space...
>

I guess the problem was due to buffering or the fact that I was not
unlinking the semaphore properly when killing the process. It seems ok
now, thanks very much for your help.


-- 
Paulo Jorge Matos - pocmatos at gmail.com
http://www.pmatos.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]