BUG: Sample MTTEST.FOR Compile Errors

ID: Q118338


The information in this article applies to:
  • Microsoft Fortran Powerstation 32 for Windows NT, version 1.0


SYMPTOMS

When you compile the multithread example MTTEST.FOR, the compiler generates the following error messages:

MTTEST.FOR(12) : error F2328: CREATETHREAD : already typed
MTTEST.FOR(12) : error F2328: WAITFORMULTIPLEOBJECTS : already typed
MTTEST.FOR(19) : error F2611: CREATETHREAD : formal argument THREAD_FUNC : actual not subprogram


CAUSE

The sample program contains two errors.

  • CreateThread() and WaitForMultipleObjects() are declared. This is not necessary, because the correct declarations are already in the include file, MT.FD.


  • CreateThread() is passed the location of the routine rather than the routine itself.



RESOLUTION

The CreateThread() and WaitForMultipleObjects() declarations are not needed and should be removed. Delete the line 12 from MTTEST.FOR:


   integer*4   CreateThread, WaitForMultipleObjects 
CreateThread() expects a subprogram, not a location. Remove the syntax "LOC()" from line 19 of MTTEST.FOR:

   handle(i) = CreateThread (0, 0, LOC (Task), temp(i), 0, myid) 
After the correction is made, the line will be as follows:

   handle(i) = CreateThread (0, 0, Task, temp(i), 0, myid) 
In addition to the actual errors, the program takes an unnecessarily long time to run. The number of milliseconds it waits in the "task" routine should be reduced from 10000 to 1000 or less. In MTTEST.FOR, change

   call sleepqq(10000*seq) 
-to-

   call sleepqq(1000*seq) 


STATUS

Microsoft has confirmed this to be a bug in the FORTRAN PowerStation 32 for Windows NT, version 1.0. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Additional query words: 1.00

Keywords : kberrmsg kbFortranPS kbLangFortran
Version : :1.0
Platform : NT WINDOWS
Issue type :


Last Reviewed: November 1, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.