<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Multithreading in Batch Script, Part 1: An Example</title>
	<atom:link href="http://caseelse.net/2008/05/22/multithreading-in-batch-script-part-1-an-example/feed/" rel="self" type="application/rss+xml" />
	<link>http://caseelse.net/2008/05/22/multithreading-in-batch-script-part-1-an-example/</link>
	<description>/*** Code's last stand ***/</description>
	<lastBuildDate>Mon, 24 Oct 2011 08:14:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Jun Cao</title>
		<link>http://caseelse.net/2008/05/22/multithreading-in-batch-script-part-1-an-example/comment-page-1/#comment-356</link>
		<dc:creator>Jun Cao</dc:creator>
		<pubDate>Sat, 26 Feb 2011 22:30:19 +0000</pubDate>
		<guid isPermaLink="false">http://caseelse.net/?p=18#comment-356</guid>
		<description>It seems can be done with START in a very simple way as below:

ECHO start run E1.exe
START /B E1.exe
ECHO start run E2.exe
E2.exe
ECHO End

Jun</description>
		<content:encoded><![CDATA[<p>It seems can be done with START in a very simple way as below:</p>
<p>ECHO start run E1.exe<br />
START /B E1.exe<br />
ECHO start run E2.exe<br />
E2.exe<br />
ECHO End</p>
<p>Jun</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jun Cao</title>
		<link>http://caseelse.net/2008/05/22/multithreading-in-batch-script-part-1-an-example/comment-page-1/#comment-355</link>
		<dc:creator>Jun Cao</dc:creator>
		<pubDate>Sat, 26 Feb 2011 19:07:10 +0000</pubDate>
		<guid isPermaLink="false">http://caseelse.net/?p=18#comment-355</guid>
		<description>Application Author and All users:

Does this â€œMultithreading in Batch Scriptâ€ only work on multiple computers or it can also work in single computer?
I am looking for a way to make â€œMultithreading Batch fileâ€ running in a single computer.  For example, I want to start two executables such as E1.exe and E2.exe in a single computer.  
E1.exe is a 5 seconds time delay and in its end showing â€œEnd of E1â€.
E2.exe is a 2 seconds time delay and in its end showing â€œEnd of E2â€.
I want this â€œMultithreading Batch fileâ€ starts E1.exe and E2.exe almost same time.  The expect results are:
	2 seconds after started this â€œMultithreading Batch fileâ€ PC showed â€œEnd of E2â€.
	3 more seconds later PC showed â€œEnd of E1â€.

Could you teach me how to do it?

Thanks!

Jun</description>
		<content:encoded><![CDATA[<p>Application Author and All users:</p>
<p>Does this â€œMultithreading in Batch Scriptâ€ only work on multiple computers or it can also work in single computer?<br />
I am looking for a way to make â€œMultithreading Batch fileâ€ running in a single computer.  For example, I want to start two executables such as E1.exe and E2.exe in a single computer.<br />
E1.exe is a 5 seconds time delay and in its end showing â€œEnd of E1â€.<br />
E2.exe is a 2 seconds time delay and in its end showing â€œEnd of E2â€.<br />
I want this â€œMultithreading Batch fileâ€ starts E1.exe and E2.exe almost same time.  The expect results are:<br />
	2 seconds after started this â€œMultithreading Batch fileâ€ PC showed â€œEnd of E2â€.<br />
	3 more seconds later PC showed â€œEnd of E1â€.</p>
<p>Could you teach me how to do it?</p>
<p>Thanks!</p>
<p>Jun</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil</title>
		<link>http://caseelse.net/2008/05/22/multithreading-in-batch-script-part-1-an-example/comment-page-1/#comment-354</link>
		<dc:creator>Neil</dc:creator>
		<pubDate>Fri, 21 Jan 2011 22:37:37 +0000</pubDate>
		<guid isPermaLink="false">http://caseelse.net/?p=18#comment-354</guid>
		<description>Very possibly:
Doing this sort of machination in batch is not going to be very efficient, at all. Plus it&#039;s not all that easy to maintain--it&#039;s kludgy. Writing it was largely just an exercise.

That being said; where this makes all its&#039; speed up is that things like ping are relatively long-running, external processes. ie, when you ping a machine, you don&#039;t do anything until it gets back; just wait. Waiting for multiple things at once is a performance boost; but *processing* multiple things at once might be a performance hit.

Think of it like this: if you have 5 book reports to write, writing them out all at the same time is not going to be faster than doing them one-at-a-time. And the overhead of switching back and forth is likely to make it slower. OTOH, if you&#039;re waiting for phone calls from 5 different people, you might as well get the balls all rolling at once.

If your jobs are being processed on the local machine--especially if they are processor intensive--you may not see enough gain to make this worthwhile.

If you&#039;re triggering (and waiting for) remote tasks (eg, on a database server) then similarly; if they are intensive, you possibly might do as well to run them one at a time. But aside from doing speed tests, there isn&#039;t a certain answer.</description>
		<content:encoded><![CDATA[<p>Very possibly:<br />
Doing this sort of machination in batch is not going to be very efficient, at all. Plus it&#8217;s not all that easy to maintain&#8211;it&#8217;s kludgy. Writing it was largely just an exercise.</p>
<p>That being said; where this makes all its&#8217; speed up is that things like ping are relatively long-running, external processes. ie, when you ping a machine, you don&#8217;t do anything until it gets back; just wait. Waiting for multiple things at once is a performance boost; but *processing* multiple things at once might be a performance hit.</p>
<p>Think of it like this: if you have 5 book reports to write, writing them out all at the same time is not going to be faster than doing them one-at-a-time. And the overhead of switching back and forth is likely to make it slower. OTOH, if you&#8217;re waiting for phone calls from 5 different people, you might as well get the balls all rolling at once.</p>
<p>If your jobs are being processed on the local machine&#8211;especially if they are processor intensive&#8211;you may not see enough gain to make this worthwhile.</p>
<p>If you&#8217;re triggering (and waiting for) remote tasks (eg, on a database server) then similarly; if they are intensive, you possibly might do as well to run them one at a time. But aside from doing speed tests, there isn&#8217;t a certain answer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: B.Torres</title>
		<link>http://caseelse.net/2008/05/22/multithreading-in-batch-script-part-1-an-example/comment-page-1/#comment-353</link>
		<dc:creator>B.Torres</dc:creator>
		<pubDate>Fri, 21 Jan 2011 18:03:35 +0000</pubDate>
		<guid isPermaLink="false">http://caseelse.net/?p=18#comment-353</guid>
		<description>I am basically running a set of batch jobs, about 3 and 4 at a time and then checking the database to see if they are completed or not. Once they are completed, I run another set of batch jobs, about 3 or 4 at a time. 
Do you think just running them off the command line one after another is just as efficient?</description>
		<content:encoded><![CDATA[<p>I am basically running a set of batch jobs, about 3 and 4 at a time and then checking the database to see if they are completed or not. Once they are completed, I run another set of batch jobs, about 3 or 4 at a time.<br />
Do you think just running them off the command line one after another is just as efficient?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil</title>
		<link>http://caseelse.net/2008/05/22/multithreading-in-batch-script-part-1-an-example/comment-page-1/#comment-352</link>
		<dc:creator>Neil</dc:creator>
		<pubDate>Thu, 20 Jan 2011 19:33:39 +0000</pubDate>
		<guid isPermaLink="false">http://caseelse.net/?p=18#comment-352</guid>
		<description>B.Torres,
It would depend on how you wanted to run things; but since this script just copies a template script and runs it, you would just adjust the template it copies. If you need to cycle them, or something, you would work out a system similar to how this deals with attached drives, or how part 2 deals with multiple computers.
You would need to work out if you were going to run the scripts repeatedly or just once each, and things like that.
If you&#039;re just running 3-4 jobs at once and ending, and don&#039;t really need the return codes, you might be better off just launching them as detached processes (eg, with the START command).</description>
		<content:encoded><![CDATA[<p>B.Torres,<br />
It would depend on how you wanted to run things; but since this script just copies a template script and runs it, you would just adjust the template it copies. If you need to cycle them, or something, you would work out a system similar to how this deals with attached drives, or how part 2 deals with multiple computers.<br />
You would need to work out if you were going to run the scripts repeatedly or just once each, and things like that.<br />
If you&#8217;re just running 3-4 jobs at once and ending, and don&#8217;t really need the return codes, you might be better off just launching them as detached processes (eg, with the START command).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: B.Torres</title>
		<link>http://caseelse.net/2008/05/22/multithreading-in-batch-script-part-1-an-example/comment-page-1/#comment-351</link>
		<dc:creator>B.Torres</dc:creator>
		<pubDate>Thu, 20 Jan 2011 15:54:27 +0000</pubDate>
		<guid isPermaLink="false">http://caseelse.net/?p=18#comment-351</guid>
		<description>How do I use this process to run 3-4 batch jobs simultaneously from potentially the same directory. Also, I will be pinging the database to see when the job is complete.</description>
		<content:encoded><![CDATA[<p>How do I use this process to run 3-4 batch jobs simultaneously from potentially the same directory. Also, I will be pinging the database to see when the job is complete.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil</title>
		<link>http://caseelse.net/2008/05/22/multithreading-in-batch-script-part-1-an-example/comment-page-1/#comment-332</link>
		<dc:creator>Neil</dc:creator>
		<pubDate>Sun, 09 Aug 2009 16:49:52 +0000</pubDate>
		<guid isPermaLink="false">http://caseelse.net/?p=18#comment-332</guid>
		<description>Demaster, What you&#039;re looking for is covered in &lt;a href=&quot;http://caseelse.net/2008/05/22/multithreading-in-batch-script-part-2-running-code/&quot; rel=&quot;nofollow&quot;&gt;Part 2&lt;/a&gt;.

Part 2 takes a second bat file, and throws it against a list of PCs. A sample second bat is included, which connects to the PC, yadda, yadda, and then cleans up after itself.

If you swedge your code into the &quot;Variable Bit&quot; part of the script, it should do what you want.</description>
		<content:encoded><![CDATA[<p>Demaster, What you&#8217;re looking for is covered in <a href="http://caseelse.net/2008/05/22/multithreading-in-batch-script-part-2-running-code/" rel="nofollow">Part 2</a>.</p>
<p>Part 2 takes a second bat file, and throws it against a list of PCs. A sample second bat is included, which connects to the PC, yadda, yadda, and then cleans up after itself.</p>
<p>If you swedge your code into the &#8220;Variable Bit&#8221; part of the script, it should do what you want.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Demaster</title>
		<link>http://caseelse.net/2008/05/22/multithreading-in-batch-script-part-1-an-example/comment-page-1/#comment-331</link>
		<dc:creator>Demaster</dc:creator>
		<pubDate>Wed, 29 Apr 2009 07:50:02 +0000</pubDate>
		<guid isPermaLink="false">http://caseelse.net/?p=18#comment-331</guid>
		<description>I&#039;d definitely like to multitask a script I&#039;ve written in BATCH, but this process doesn&#039;t help me.  I have a zipped file on 40 servers that I&#039;d like to decompress on each server.  Currently my script does the decompression on one server...then moves to the next.  Any sample ideas of how I multitask something like this to launch the process of decompression on more than one server at a time?  Thanks in advance.</description>
		<content:encoded><![CDATA[<p>I&#8217;d definitely like to multitask a script I&#8217;ve written in BATCH, but this process doesn&#8217;t help me.  I have a zipped file on 40 servers that I&#8217;d like to decompress on each server.  Currently my script does the decompression on one server&#8230;then moves to the next.  Any sample ideas of how I multitask something like this to launch the process of decompression on more than one server at a time?  Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Awesome Find #7: Multithreading in Batch Scripts &#124; Daily Cup of Tech</title>
		<link>http://caseelse.net/2008/05/22/multithreading-in-batch-script-part-1-an-example/comment-page-1/#comment-298</link>
		<dc:creator>Awesome Find #7: Multithreading in Batch Scripts &#124; Daily Cup of Tech</dc:creator>
		<pubDate>Thu, 26 Mar 2009 13:00:50 +0000</pubDate>
		<guid isPermaLink="false">http://caseelse.net/?p=18#comment-298</guid>
		<description>[...] Case Else: has come to the rescue by providing a two part tutorial on how to perform multithread actions using batch files!&#160; From the website: Multithreaded [...]</description>
		<content:encoded><![CDATA[<p>[...] Case Else: has come to the rescue by providing a two part tutorial on how to perform multithread actions using batch files!&nbsp; From the website: Multithreaded [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

