// JP opened flex table

Click to See Complete Forum and Search --> : diferences in multithreading between wXP & 2000


rgalopo
October 5th, 2007, 10:50 AM
Hi all !

I’m developing a multithreading C# application in which one I invoke several web service methods in the same machine. Those web services have been developed with java / Apache web server, and I can’t change them.
The multithreaded application has a heavy CPU percent usage.
It runs perfect in W2000, but in XP it has big performance problems, it seems to have a queue of threads and the second thread don't perform any task until the first thread is doing nothing.
The CPU usage is equal in both O.S. and I'm using .net 2 platform in both O.S.

Do you know what it’s different in multithreading / multiapp management between both O.S.?
Any idea to reduce the cpu usage percent?. Somebody told me about use timers to launch short life threads, avoiding while(true) threads.

Advanced Thanks!

JVene
October 5th, 2007, 03:50 PM
I'm not aware of any dramatic differences in the thread scheduling system of XP over 2000 (or event NT 3.51 for that matter) - I have no information on Vista, but indications so far are that it hardly differs from the previous standards in this regard either.

There is more likely significant differences in the .NET platform itself, perhaps related to the manner of that installation's update of the .NET libraries. Versions of .NET for Windows 2000 may have different services turned off relative to XP, but unless there's some OS service being requested in 2000 that functions differently under XP, I can't begin to offer information without some example code to investigate.

The notion of 'while(true)' loops being an issue strikes me as a Linux portability warning, unless the information relates to a thread consuming 100% CPU power as a result of the infinite loop. Linux thread schedule does appear to function differently inside loops (for loops, too) than XP/2000, but at present I'm not sure why or just what causes it. It appears that threads launched in Linux don't time slice inside a while loop the way Windows does.

//JP added flex table