Hanging thread in CMG when used w/ borland compiled pthread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hanging thread in CMG when used w/ borland compiled pthread



Hi all,

I'm having trouble figuring this out but perhaps someone here might have 
an idea about what the problem is. I'm not too familiar with pthreads and 
I haven't any multithreading application before. 

I've been trying to compile the CMG library here using borland's free 
compiler:

http://www-2.cs.cmu.edu/~cm-gfxpkg/

One of the components it needs is pthread. I don't see a makefile that 
works with borland's compiler so I created my own make for compiling the 
pthread source. Everything compiles ok and a pthread.dll and pthread.lib 
was produced. I then proceed to use those two files in compiling CMG and 
that works as well.

Now the part I'm having trouble with. I compile a simple test program 
using CMG and then attempted to run it. It runs fine but the problem 
comes when I try to exit the test program. When I press escape to exit, 
the test program window is just stuck there. Anything I do afterwards it 
doesn't respond. For me to make it quit, I would need to go to it's 
console window and press ctrl-c or ctrl-break. This only happens when I 
use the pthread.dll and .lib I built myself but it doesn't happen if I 
use one of the precompiled VC pthread.dll and create a pthread.lib from 
that.

As I've said, I have no experience with thread programming but from the 
looks of it, it seems one of the threads are hanging. I did a search of 
this problem in the pthread mailing-list looking for anything there that 
might describe what looks like my problem. I found something that said 
optimization could have side-effects in thread cancelling or something 
like that. So I rebuilt the pthread source again but this time completely 
disabling any opts or function inlining. I tried the whole thing again 
but the problem still persist. 

Well, I've described my problem as much as I can in a nutshell but if you 
guys need any more info, just ask. Anyone have any idea what could be 
causing this hanging window problem when quitting the application using 
pthreads please post your replies here? That would be greatly 
appreciated!

Thanks