![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

A quick follow-up on multiprocessor/multi-tasking.
I loaded the sample code at the end of TASKER.F
These samples indeed captured both CPU's at 100%. I determined that my large arrays are causing large overhead so I cannot get this efficiency using multi-tasking. I then tried starting a second process. Now I can capture 100% of both processors. It looks like I may have wasted my efforts in making the code re-entrant. Oh Well. I need to think about coordinating the multi-processes.
Ken B
At 02:58 PM 5/9/2007, you wrote:
>Hi Rick
>
>Thanks for the quick response.
>
>When I run SF I see it getting cycles on both CPU's in the Task Manager Performance graph which confirms that the process affinity has been set to both CPU's. (Since you do not have a dual processor system you may not know that the CPU graph is now split into two pieces for a dual system.)
>
>I have tried the following two functions to put the individual thread on a specific CPU whithout any success yet.
>Function: SetThreadAffinityMask ( a b -- x )
>Function: SetThreadIdealProcessor ( a b -- x )
>The values returned are 0 for SetThreadAffinityMask and -1 for the SetThreadIdealProcessor. Both are the error return so the functions were not able to set the processor affinity. (I love Windows inconsistent flag usage). Both functions require that the handle have the THREAD_SET_INFORMATION access right. I suspect the handle I am getting from TASK1 TASKHANDLE does not have this right.
>
>So now my question is how do I get a handle that has this right. Is it requested during CONSTRUCT which is buried in ACTIVATE?
>
>Ken B
>
>
>At 01:24 PM 5/9/2007, you wrote:
>>Kenneth,
>>
>>Some windows explorer extensions set the processor affinity for
>>Explorer, and even if you launch SF.EXE with its own affinity
>>settings, they may not "take". Try setting the processor affinity
>>directly in your application by calling SetProcessAffinityMask and see
>>if that makes a difference.
>>
>>I don't have a multiple cpu computer to test against.
>>
>>rick
>>----------------------------------------------------------------------
>>sftalk_at_forth.com The SwiftForth programming discussion email list
>>To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
>>For list command help, send subject "help" to sftalk-request_at_forth.com
>>Message archives are located at http://www.forth.com/archive/sftalk
>>----------------------------------------------------------------------
>>This list is a forum for SwiftForth users. For product support and
>>bug reports, please send email to support_at_forth.com
>>----------------------------------------------------------------------
>
>
>Dr. Kenneth B Butterfield
>
>phone: 505 667 8944
>
>PO Box 1663
>ms J562
>Los Alamos National Laboratory
>Los Alamos New Mexico 87545
>
>"I do not trust a computer that I am not carrying!"
>
>
>----------------------------------------------------------------------
>sftalk_at_forth.com The SwiftForth programming discussion email list
>To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
>For list command help, send subject "help" to sftalk-request_at_forth.com
>Message archives are located at http://www.forth.com/archive/sftalk
>----------------------------------------------------------------------
>This list is a forum for SwiftForth users. For product support and
>bug reports, please send email to support_at_forth.com
>----------------------------------------------------------------------
Dr. Kenneth B Butterfield
phone: 505 667 8944
PO Box 1663
ms J562
Los Alamos National Laboratory
Los Alamos New Mexico 87545
"I do not trust a computer that I am not carrying!"
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and
bug reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Mon May 14 2007 - 15:09:54 PDT
This archive was generated by hypermail 2.2.0 : Wed Jan 07 2009 - 03:04:19 PST