Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Optimising code

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I've been asked to ensure that my code is optimised for :

1. Running on a Windows 2000 platform.
2. Ensuring that the system uses all processors in a multi-processor environment.

How should I approach this ?
The system was designed and developed on a Windows NT machine (with only one processor) - how can I assure that the code is designed to fit the requirements as above ?

Any help would be appreciated.

Thanks in advance.

Steve
 
A lot depends on if your code is written to be multi-threaded.

If it is, and you haven't been testing on a multiproc box, then there will be subtle errors that will show up only in production. Multi-threading on a single-CPU machine is really only simulated - you need a dual-CPU PC to really find all the bugs. Tell your boss to let you build one (I like Supermicro motherboards for this, but Tyan is good too) or buy one. Otherwise you're wasting your time and his money.

To ensure your code uses all CPUs, make sure your app is written to be multi-thread correct (my point above). Additionally, Microsoft recommends 4 threads per CPU for any single processor-intensive task (like a web server, or FTP server). You'll want to make sure you use asynchronous callbacks to minimize the wait time your app has (thread busy-loops while waiting for network activity, etc).

Chip H.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top