Pthreads / NT Threads under win32

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.

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.

Thanks,
Eric

Under Cygwin, configure finds pthreads:


checking for the pthreads library -lpthreads… no
checking whether pthreads work without any flags… yes
checking for joinable pthread attribute… PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads… no

Not sure about MinGW.

Brian

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.

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 POSIX Threads (pthreads) for Win32 can be used in
GNU Radio? I would be happy to help if that is what is needed.

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

– Don W.

On Wed, Apr 04, 2007 at 03:48:48PM -0400, Brian P. wrote:

Brian

Thanks!

Eric

On Wed, Apr 04, 2007 at 04:44:22PM -0400, Don W. 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 POSIX Threads (pthreads) for 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

BUT, pthreads/win32 is available from cygwin. It compiles with mingw or
msvc. To my mind, they have done a good job. Threading code that
Brickle wrote ran immediately under pthreads/win32. There is some
chance omnithreads would work using this.

Bob

Don W. wrote:

Threads in gr_omnithread. If we did this, we could then take advantage

– Don W.


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


AMSAT Director and VP Engineering. Member: ARRL, AMSAT-DL,
TAPR, Packrats, NJQRP, QRP ARCI, QCWA, FRC. ARRL SDR WG Chair
“Taking fun as simply fun and earnestness in earnest shows
how thoroughly thou none of the two discernest.” - Piet Hine