discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Re: pthreads / NT Threads under win32


From: Eric Blossom
Subject: [Discuss-gnuradio] Re: pthreads / NT Threads under win32
Date: Wed, 4 Apr 2007 14:34:15 -0700
User-agent: Mutt/1.5.9i

On Wed, Apr 04, 2007 at 04:44:22PM -0400, Don Ward wrote:
> >Can any of you who build GNU Radio under MinGW or Cygwin please let me
> >know whether our omnithread implementation ends up using pthreads or
> >NT threads?  
> >
> >You should be able to tell by looking at the output from running
> >configure.  If you see a message "checking for NT threads" it means we
> >didn't find pthreads.
> 
> GNU Radio uses pthreads on Cygwin, but uses NT threads on MSYS/MinGW.

Thanks.

> >Why I ask, is that I'm considering removing the support for NT
> >Threads in gr_omnithread.  If we did this, we could then take advantage
> >of the posix thread cancellation features, which aren't currently
> >available in the omnithread interface.
> 
> Could you elaborate on what you want to do?  Would we use pthreads
> directly or would we still be using omnithread?  Should we find out
> if Pthreads-win32 http://sourceware.org/pthreads-win32 can be used in
> GNU Radio?  I would be happy to help if that is what is needed.

I wouldn't use pthreads directly, since omnithread provides a much
friendlier C++ interface.  However, behind the scenes I might want to
take advantage of POSIX specific calls to get some things taken care
of.  In particular I'm looking at the interactions of signals and
threads and how to correctly handle ^C (SIGINT) and friends such that
the right things happen and everything is cleaned up properly.

> I prefer to use GNU Radio on MSYS/Mingw and am willing to put in some
> effort to keep it running there.

Very good.  Thanks.

BTW, thread cancellation and C++ looks like a bad mix.
The consensus is, "Just say no."

Adroit use of sigaction, pthread_sigmask and pthread_kill might get me
what I want, however it looks like pthreads-win32 stubs them out.

How does ^C handling work natively on win32?  
How about under MinGW and Cygwin?

FYI, I'm working on the thread-per-mblock scheduler now, and would
like to get this right the first time around.

Eric




reply via email to

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