
Multithreading in Visual C++ programmes
I have a C++ program that calls a C++ routine that takes about 15 minutes to
execute (if there is enough
virtual memory, that is). I've never had the problem you have, and I've
never heard about "a function taking
too long" from windows (of course, I've heard that often enough from my
customers...).
Is it possible that your code does some message processing (like
PumpMessage, PeekMessage, ...)?
This could disturb MFC.
Niki
Quote:
> Hi there,
> I have some C++ code that calls a FORTRAN routine which takes between
> 60seconds and four or five minutes to complete and return back.
> The actual FORTRAN code is working fine (in the de{*filter*} I can watch
> variables and check that they're being changed correctly).
> However, once control returns back from the routine the programme crashes
in
> thrdcore.cpp at the line:
> if (IsIdleMessage(&m_msgCur))
> {
> bIdle = TRUE;
> lIdleCount = 0;
> }
> 15bytes in, actually, at the code line
> 5F438D3D call dword ptr [edx+6Ch]
> (if that helps, which I doubt).
> My guess is that the FORTRAN routine is taking so long that it is blocking
> programme message processing. Is this likely/possible?
> Because I'm fairly new to all this, my next guess may well sound stupid,
but
> I think I should start the FORTRAN routine as a separate thread.
> Reading up on this, it appears that routines started in separate threads
can
> only have one argument passed to them. If so, then I don't know what to
do
> as the FORTRAN routine requires six parameters.
> Any suggestions welcome,
> Charlie