Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why Processing Performance is Not Increasing ?
Message
De
15/02/2014 17:21:13
 
 
À
15/02/2014 14:49:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01594373
Message ID:
01594432
Vues:
45
I posted some info about the i7-4770K in message#1594431 . Hyperthreading doesn't yield much extra performance, you can really think of it as a 4-core processor with about 20-30% better performance.

I think trying to run any more than 4 job threads on a 4770K is probably a mistake, it'll just cause unnecessary context switching.

I can't help but think this whole ParallelFox thing is a massive red herring. If you're using AppX to process a list of 1M files, my first approach would be to divide that into 4 lists of 250K files each, and run 4 separate instances of AppX, one for each list. Or 3 lists 333K each w/3 instances, 5 lists 200K each w/5 instances, you get the idea. No need for any attempts at parallel processing and its related complications and overhead. No need to change the original program other than to make it accept an input parameter for the list it's supposed to process.

>Hmmm.... that's not good. Who maintains Parallel Fox? Perhaps they can add that feature. It would seem to be an important thing to know, perhaps optionally as a lot of times you don't care, cut some times you do care.
>
>The GetCurrentThread() function will retrieve a handle to the current thread, which will most likely be a very large integer, and not the sequential thread number.
>
>One way you can simulate determining which thread you are is to have the spawning parent thread (the one which launches the Parallel Fox worker threads) to, before it launches any of the worker threads, create the CPU count of files like "file1.txt", "file2.txt" ... "file8.txt" for an 8-core with 8-threads. Then, in your startup algorithm of each thread, search sequentially from 1 to 8 trying to gain exclusive access to one of those files by using FOPEN() with read/write setting. Once that file is open, you'll know that's your thread number and you can proceed to lock onto that ps2pdf.dll copy. Keep the fileN.txt file open until your thread terminates, then close it. By iterating from 1 to 8 you should be able to always determine a thread number assignment. And, if you spawn two or more threads per core (not a bad idea on a Core i7 8-core) you can create file1.txt ... file16.txt, and so on.
>
>In the alternative, use a table and sequentially replace a column with whatever value it is plus one, either opening the table exclusively, or using a lock, getting your value, updating the value, then closing the table (if using it exclusively). That way you can guarantee atomic access to the table so that every process will only get its value, and all of them will be 1..8, or 1..16.
>
>Good luck, Harsh. Your programming skills and resourcefulness have really improved over the past many months.
>
>
>-----
>>Sir, there is no function in Parallel Fox to identify the Thread Number. I will try the next option suggested by you also
>>I found WINAPI in news2news.com for getting the thread number. I will try both and will seek your help again on the
>>issue later.
>>
>>Here it is
>>
>>
>>DECLARE INTEGER GetCurrentThread;
>>    IN kernel32
>>
>>
>>Harsh
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform