Silverfrost Forums

Welcome to our forums

Running Silverfrost's Thread Sample

15 Jul 2019 4:52 #24008

The FTN95 Help system includes a 'Threads Sample' code snippet. When I paste this sample code into Plato and try to compile, I get compiler errors such as 'ASSEMBLY_EXTERNAL is only allowed in CLR mode (with /CLR switch specified)'.

I can't find any instructions on CLR mode. Looking at the ASSEMBLY_EXTERNAL Help topic I see that since it is a .NET method, I have to add a LIBRARY directive, but don't know what library to point to.

What specifically do I need to do to get the Threads Sample code to compile and run?

Thanks! Clay

15 Jul 2019 5:24 #24010

First thing to check, you must compile with 64 bit not 32 bit to use threads.

see the file notes_on_parallel_processing

in C:\Program Files (x86)\Silverfrost\FTN95\doc

Ken

15 Jul 2019 5:31 #24011

The 'Threads sample' is for .NET only.

There are three platforms Win32, .NET and x64. Which one do you want to use?

15 Jul 2019 7:28 #24012

PaulLaidler: Thanks for the reply, building with .NET allowed the example code to compile, but it still won't run. When I run it I get a FTN95 exception: Salford.Fortran.RuntimeException Error 359: Control is too big for window

Any idea what's going wrong with the example code?

Thanks.

15 Jul 2019 7:35 #24013

Kenneth_Smith: Thanks very much for the tip about the notes_on_parallel_processing file. Very helpful!

When I paste the example code into Plato and compile with 64-bit, the program freezes when run. When I run it in the debugger, it gets to the line:

ID=GetParallelTaskID@(1)

the debugger simply says 'Status: Program Terminated'

You can surely tell that I'm new to parallel processing, but would be interested in investigating if I could get an example program to execute for me to play with.

Thanks in advance for any advice or assistance! Clay

17 Jul 2019 3:55 #24022

I just tried the .NET threads example and it ran okay for me. How did you run it Clay?

Please login to reply.