473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Invoking External Batch Program on Multiple Core Machine

Hello! You may remember me as the guy who's trying to learn C# and using
that old version 2003 of visual studio. (Although free version of command
line .NET compiler is available, so if some new feature would greatly
simplify my life, then I am not opposed)

I currently have an application that is single threaded that does batch work
(you pass it a file in the command line, it runs for 2-45 minutes and spits
out another file). I do not own the application and do not know what it is
written in.

This is very annoying since I have a dual core machine and would like to get
my work done as quickly as possible.

Is there a way to invoke a foreign application from C# to run on a specified
core? (If so, can you point me to an example?)

Right now we do our work, click "compile" and then wait. Eventually I would
like to try to implement some form of distributed computing on all our
office computers, so that someone needing to compile 4-5 items can occupy
the same number of idle cores accross the network.

To implement this I want to make a generic C# workhorse program that waits
around for work, occupies all cores until the work is done and returns the
results as soon as possible. I'm hoping that through smart use of
inheritance, I can make the differences between the distributed client and
the local client as little as possible.

Note: I have deliberately excluded details on what the compilation is for,
just in case my employer would have a problem with it (even though I doubt
they would).

--
LTP

:)
May 16 '07 #1
1 1795
On Wed, 16 May 2007 01:35:57 -0700, Luc The Perverse
<sl***********************@cc.usu.eduwrote:
Hello! You may remember me as the guy who's trying to learn C# and using
that old version 2003 of visual studio. (Although free version of
command line .NET compiler is available, so if some new feature would
greatly
simplify my life, then I am not opposed)
A free version of the *IDE* is available, not just the command line
compiler. You should upgrade, VS 2005 is very nice (I haven't used 2003,
but I have a friend who is using it now and every time I mention "well, VS
does this for me" he always finds himself saying "really? VS 2003 doesn't
do that"...I gather it's a pretty significant upgrade, and frankly I was
surprised at how much was left usable in the Express version, considering
it's free).
I currently have an application that is single threaded that does batch
work (you pass it a file in the command line, it runs for 2-45 minutes
and spits out another file). I do not own the application and do not
know what it is written in.

This is very annoying since I have a dual core machine and would like to
get my work done as quickly as possible.
So long as you remember that "dual core" does not mean "dual hard drive"
or "dual RAM". :) Depending on what that application is actually doing,
you may or may not realize benefits by having it run in the background
while you try to get something else done.
Is there a way to invoke a foreign application from C# to run on a
specified core? (If so, can you point me to an example?)
You can use the Process class to start a new process with a specific
command, and you can even set the ProcessorAffinity on the class instance
to control what CPUs it runs on. However, why would you want to set a
specific CPU? Windows is smart enough to distribute the workload fairly
across whatever CPUs are available. There's no need to assign the process
to a specific one.
Right now we do our work, click "compile" and then wait. Eventually I
would like to try to implement some form of distributed computing on all
our
office computers, so that someone needing to compile 4-5 items can occupy
the same number of idle cores accross the network.
The idea is sound. So sound, in fact, that I'm pretty sure I've read of
implementations that already exist to do this sort of thing. I think
there are even general-purpose solutions that you might be able to use
off-the-shelf. That said, depending on what exactly you're trying to do,
it may not be very hard to do it. Use some sort of peer-to-peer
architecture to control workload requests (.NET remoting? Socket? WCF?
Whatever...), run the process (capturing the output if you like).

Just keep in mind the caveat I mentioned at the outset: just because a CPU
core is available, that doesn't mean that running a process on the
computer won't impact whatever work someone else is already doing on the
computer.

Pete
May 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

47
by: Richard Hayden | last post by:
Hi, I have the following code: /******************************** file1.c #include <iostream> extern void dummy(); inline int testfunc() {
2
by: Michel Schilthuizen | last post by:
Hi, I am working on an application that can use functionlity in some sort of plugins. I have implemented this by using Assembly.LoadFrom and MethodInfo.GetMethods. The calling of the plugins...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
4
by: Ê÷Éϲä»Ò | last post by:
'rar' is not recognized as an internal or external command, operable program or batch file. import os import time source = target_dir = r'e:\temp\bak' target =...
4
by: | last post by:
Hello, I am attempting to convert multiple .wav files to the .flac format via a batch script. I know that this can be done with numerous software implementations automatically for me; however, i am...
60
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the...
14
by: Gio Galma | last post by:
how I can invoke the db2diag utility in a Windows environment? in my D:\Program Files\IBM\SQLLIB\BIN directory I can see only db2diag.dll, and it seems there isn't the command line version; which...
1
by: Emerald Saint | last post by:
Hi. I been away and didn't get here again until now. Thank you for your offer to share programs that you have. I studied up and refreshed my memory about linkers and compilers. So I have the...
6
by: John O'Flaherty | last post by:
Hello. I have an ms acess database that I use to track my mp3 files. I have included code that lets me select and play files by invoking an mp3 player (Winamp). This is done by using visual basic...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.