[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Linux Semaphores
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] Linux Semaphores |
Date: |
Wed, 25 Oct 2006 23:45:42 -0700 |
User-agent: |
Mutt/1.5.9i |
On Thu, Oct 26, 2006 at 10:43:08AM +0800, Jeremy Chew wrote:
> I'm working on developing TDMA on GR using RedHat Enterprise Linux WS 2.6.
> I intend to use semaphores or mutex for controlling access to shared memory
> when events like packet arrivals and timeouts occur.
OK
> However, I understand based on the man pages that a number of the calls for
> semaphores and mutex may cause a deadlock when the calling thread happens
> to be handling an asynchronous signal.
OK
> First of all, what are asynchronous signals in this context?
They mean "signals" as defined by the kernel system calls
signal(2), kill(2), sigaction(2), etc. Try "man sigaction"
> If they refer to events whose time occurance is unpredictable,
> wouldn't such signals apply to a really large number of cases,
> including packet arrivals?
No.
> The man pages say that sem_post is the only POSIX call that handles
> asynchronous signals fine. What use is this if I can't use sem_wait with
> asynchronous signals?
>
> What is your experience with semaphores and mutex?
More years than I like to think about ;)
You may want to spend some time with a good book on Unix or Linux
programming. Sorry, I don't have a specific recommendation.
Eric