<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic CreateThread in Fortran in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CreateThread-in-Fortran/m-p/769512#M109</link>
    <description>Graham,&lt;BR /&gt;&lt;BR /&gt;CreateThread is a C runtime system function:&lt;PRE class="syntax"&gt;&lt;B&gt;HANDLE&lt;/B&gt; &lt;B&gt;CreateThread(&lt;/B&gt;
  &lt;B&gt;LPSECURITY_ATTRIBUTES&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #810081;"&gt;lpThreadAttributes&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;,
&lt;/B&gt;  &lt;B&gt;SIZE_T&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #810081;"&gt;dwStackSize&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;,
&lt;/B&gt;  &lt;B&gt;LPTHREAD_START_ROUTINE&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #810081;"&gt;lpStartAddress&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;,
&lt;/B&gt;  &lt;B&gt;LPVOID&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #810081;"&gt;lpParameter&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;,
&lt;/B&gt;  &lt;B&gt;DWORD&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #810081;"&gt;dwCreationFlags&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;,
&lt;/B&gt;  &lt;B&gt;LPDWORD&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #810081;"&gt;lpThreadId&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;
&lt;/B&gt;&lt;B&gt;);&lt;/B&gt;
You can also call _beginthread _endthread&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 19 Aug 2011 20:54:50 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2011-08-19T20:54:50Z</dc:date>
    <item>
      <title>CreateThread in Fortran</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CreateThread-in-Fortran/m-p/769509#M106</link>
      <description>&lt;SPAN class="sectionBody"&gt;I'm trying to use the CreateThread call in Fortran (Visual Fortran Composer XE 2011).&lt;BR /&gt;&lt;BR /&gt;I supply a procedure name and a parameter to be used:-&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: x-small;"&gt;&lt;SPAN style="font-size: x-small;"&gt;&lt;FONT size="2"&gt;&lt;FONT size="2"&gt;&lt;P&gt;&lt;SPAN class="sectionBody"&gt;THandle = CREATETHREAD (0, 0 ,sched_ServerThread ,IntegerParameter ,0 ,ThreadID)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="sectionBody"&gt;Once the thread has started, the "sched_serverThread" subroutine is executed&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-size: x-small;"&gt;&lt;SPAN class="sectionBody" style="color: #0000ff; font-size: x-small;"&gt;SUBROUTINE&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: x-small;"&gt;&lt;SPAN style="font-size: x-small;"&gt;&lt;SPAN class="sectionBody"&gt; sched_ServerThread(SystemNum)&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="sectionBodyText"&gt;&lt;BR /&gt;&lt;SPAN class="sectionBody"&gt;In this subroutine, the supplied parameter (SystemNum defined as Integer*4) has an"undefined address", thus causing a few poblems in the subsequent code.&lt;BR /&gt;I presume I am doing something obviously incorrect?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT size="2"&gt;&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2011 04:16:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CreateThread-in-Fortran/m-p/769509#M106</guid>
      <dc:creator>Tote_Licences</dc:creator>
      <dc:date>2011-08-18T04:16:21Z</dc:date>
    </item>
    <item>
      <title>CreateThread in Fortran</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CreateThread-in-Fortran/m-p/769510#M107</link>
      <description>Try&lt;BR /&gt;&lt;BR /&gt;INTERFACE&lt;BR /&gt; INTEGER(HANDLE) FUNCTION sched_ServerThread(SystemNum)&lt;BR /&gt;!DEC$ ATTRIBUTES STDCALL, ALIAS:"_systemnum" :: SystemNum&lt;BR /&gt; INTEGER(4), POINTER :: SystemNum&lt;BR /&gt; END FUNCTION sched_ServerThread&lt;BR /&gt;END INTERFACE&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And have the above interface visible to both the caller and the callee&lt;BR /&gt;&lt;BR /&gt;You had two basic problems:&lt;BR /&gt;&lt;BR /&gt; You did not declare STDCALL calling conventions&lt;BR /&gt; You use subroutine when function was required&lt;BR /&gt;&lt;BR /&gt;You may be able to eliminate POINTER on SystemNum. I had it in there for use back in V8.nn when the supplied interface declarations of the Windows API was in error.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey</description>
      <pubDate>Thu, 18 Aug 2011 12:07:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CreateThread-in-Fortran/m-p/769510#M107</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2011-08-18T12:07:09Z</dc:date>
    </item>
    <item>
      <title>CreateThread in Fortran</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CreateThread-in-Fortran/m-p/769511#M108</link>
      <description>&lt;P&gt;Hi Jim,&lt;BR /&gt;Thanks for the attempt, but I seem to have a few problems implementing your solution.&lt;BR /&gt;I did change the subroutine to Integer function, thentried to compile with the supplied interface. The compiler finds that the SystemNum variable isfound to have been defined more than once with conflicting attributes. Commenting out the Pointer defintion had no effect.&lt;BR /&gt;It seems to me that the stdcall attribute would be used to interface to a C routine (which this is not) and that therefore the Alias clause should refer to the C alias to the fortran function (the C routine does not exist).&lt;BR /&gt;With that in mind I changed the Interface defintion to exclude the atttributes stdcall defintion. It then compiled OK, but failed to have any affect on the original problem.&lt;BR /&gt;Graham&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2011 00:05:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CreateThread-in-Fortran/m-p/769511#M108</guid>
      <dc:creator>Tote_Licences</dc:creator>
      <dc:date>2011-08-19T00:05:37Z</dc:date>
    </item>
    <item>
      <title>CreateThread in Fortran</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CreateThread-in-Fortran/m-p/769512#M109</link>
      <description>Graham,&lt;BR /&gt;&lt;BR /&gt;CreateThread is a C runtime system function:&lt;PRE class="syntax"&gt;&lt;B&gt;HANDLE&lt;/B&gt; &lt;B&gt;CreateThread(&lt;/B&gt;
  &lt;B&gt;LPSECURITY_ATTRIBUTES&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #810081;"&gt;lpThreadAttributes&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;,
&lt;/B&gt;  &lt;B&gt;SIZE_T&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #810081;"&gt;dwStackSize&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;,
&lt;/B&gt;  &lt;B&gt;LPTHREAD_START_ROUTINE&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #810081;"&gt;lpStartAddress&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;,
&lt;/B&gt;  &lt;B&gt;LPVOID&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #810081;"&gt;lpParameter&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;,
&lt;/B&gt;  &lt;B&gt;DWORD&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #810081;"&gt;dwCreationFlags&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;,
&lt;/B&gt;  &lt;B&gt;LPDWORD&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #810081;"&gt;lpThreadId&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;
&lt;/B&gt;&lt;B&gt;);&lt;/B&gt;
You can also call _beginthread _endthread&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Aug 2011 20:54:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/CreateThread-in-Fortran/m-p/769512#M109</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2011-08-19T20:54:50Z</dc:date>
    </item>
  </channel>
</rss>

