This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


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

What flags should I use, -mthread, -mthreads, -lmmalloc, .... ?


Hello,

I'm trying to port a program to Windows95, using cygwin 1.3.2. It 
consists of a GUI displaying data that are calculated by a background 
process, and uses templates in a multithreaded environment. It keeps 
crashing with a segfault when allocating memory for a template, either 
my own or standard templates like std::vector. BTW, the same program 
runs flawlessly for more than a week under linux. 

I tried with various compiler and linker flags, but nothing worked 
until now. Through the mingw users archives I found that it is 
necessary to use -mthreads for both compiling and linking, does this 
also work for cygwin? The linker also recognises -mthread, but the 
compiler doesn't. And in this (cygwin) list somebody (if I remember 
well it was the same person) suggested using -lmmalloc to prevent 
memory errors. The only thing that I achieved by using these flags is 
that it takes longer before it crashes: without mthreads or mmaloc 
after 5 minutes, with mthreads it may take an hour, and I do not 
remember what the added effect of lmmalloc was.

I looked in the users manual, but found no information for either 
mmaloc or -mthread(s), nor did I find any other hints for using 
templates in a multithreaded program.

Can anyone tell me what more I could try, or better yet: what the 
magical flags are to make everything work?

Thanks in advance for any help.

Regards,

Geert Karman




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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