[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] GR, WX, Omnithread, and Condition Variables

From: Krzysztof Kamieniecki
Subject: [Discuss-gnuradio] GR, WX, Omnithread, and Condition Variables
Date: Tue, 12 Apr 2005 12:41:51 -0400
User-agent: Internet Messaging Program (IMP) 3.2.2

Is anybody using omnithread condition variables with GnuRadio and WX?

I will post my code when I get home later today, but I was hoping somebody had
already solved this type of problem before.

I have created a sink block that stores N number of samples after skipping K
samples into a std::vector<>. There is an omnithread mutex that is used to
protect various data members. There is also a function (wait_for_data(seconds))
that uses a condition variable to wait a finite amount of time for the N
samples to be acquired. 

If I start a thread that calls wait_for_data before doing fg.start(), my block's
work function is never called (based on a cout << "DEBUG\n" and cout.flush) and
it looks like the flowgraph is locked up. However the thread continues to loop
and wait_for_data continues to indicate that there is no data is available, so
I beleve the mutex is being released, but I will have to double check that the
acquires and release are balanced.

If I do fg.start(), sleep for 5 seconds, then create the thread everything works
as expected for a while, but things seem to lock up again.

It looks like something is deadlocking, but I'm not exactly certain how
omnithread, WX, and GnuRadio interact in the background.

Any ideas?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]