OK, what I'd like to see is the following. Here is the shortest code which I'd like to be working in FTN95. Unfortunately it does not open another thread if you click on tab 2 after clicking on tab 1.
What it is unfortunately doing, it stops for a while execution of the function run1 when you click 2 and starts run2, when run2 finishes, run1 continues. You can see that if you open Task Manager on your multicore PC. If there would be multithreading then two cores would start the tasks independently grabbing 100% CPU time
Multithreading is the simplest way of doing simulations in parallel. We can for example devide some long running DO loop this way into deviding it to two parts and run both parts on separate threads, hence numerous cores will be improving execution speed by factor 2, 4 or 8 or N times depending on amount of your cores.
[color=green:9787c37061]It can be done with .NET as shows FTN95 Threads example, but it is kind of cumbersome. Can it be done without .NET ? .NET in current version is the complication without simplification eye candies. Most of people do not like to know even Clearwin+, which is great, so there is no way they will like the next level of complexity. Fortran lives 50+ years because it is simplicity (and due to that speed) up to ultimate stupidity. Salford/Silverfrost fortran is unique in the sense that it is the only one which can offer us the so called 'click programming' for each and everyone because it has build-in GUI builder (Clearwin+, Visual Clearwin). I'm not a visionary by any means, but IMHO time is gone for complex line-by-line programming like it is gone for lineprinters. Also IMHO everyone would use .NET if all applications were assembled by mouse clicks. Is this how it is done now using Visual Studio? This 'visual studio' is not a real visual studio I'd like to see[/color:9787c37061]
use clrwin
integer run1, run2
external run1, run2
i=winio@('%ww&')
i=winio@('%^tt[1]%ff&', run1)
i=winio@('%ac[Esc]&','exit')
i=winio@('%ac[Ctrl+1]&',run1)
i=winio@('%ac[Ctrl+2]&',run2)
i=winio@('%^tt[2]', run2)
end
!----------------------
integer function run1()
use clrwin
print*,'1 is running'
CALL PERMIT_ANOTHER_callback@()
a=2.0
do k=1,50
call temporary_yield@()
do i=1,10000000
a=alog(exp(a))
enddo
enddo
print*,'1 ended'
run1=1
end
!----------------------
integer function run2()
use clrwin
print*,'2 is running'
a=2.0
do k=1,50
call temporary_yield@()
do i=1,10000000
a=alog(exp(a))
enddo
enddo
print*,'2 ended'
run2=1
end