Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2005

Tip: Looking for answers? Try searching our database.

Threading question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bagger - 20 Jul 2005 05:23 GMT
Ok, I'm trying to learn how to use threading, but I've run into a problem.  
I'm doing this in VB.Net.  I started out making something pretty simple.  
Just a sort of wrapper for cmd.exe.  I used separate threads to read from
stdin and stderr.  It seemed to be working ok.  Then I added macros to it.  
Here's what's happening.  The sub that runs the commands gets called several
times in a row very quickly.  It's spawns a new cmd.exe process each time,
and a couple of threads to listen for the output.  The problem is that the
commands can take different amounts of time to finish, so the output I get is
all out of order.  I need to make sure that the commands run one at a time,
each one waiting until the previous one is done.  How exactly can I do that?
Bagger - 20 Jul 2005 21:55 GMT
I meant to say that I'm using separate threads to read from stdout and
stderr.  I'm not doing anything with stdin right now.  If anyone can help me
with this, it would be much appreciated.  Thanks.

> Ok, I'm trying to learn how to use threading, but I've run into a problem.  
> I'm doing this in VB.Net.  I started out making something pretty simple.  
[quoted text clipped - 6 lines]
> all out of order.  I need to make sure that the commands run one at a time,
> each one waiting until the previous one is done.  How exactly can I do that?
Alvin Bruney [MVP - ASP.NET] - 21 Jul 2005 00:03 GMT
post some code. i think you chose a difficult example. i think, not to sure
if old age is betraying me, that stdin/out/err are affined. That won't
affect the read order but it may cause some exceptions. if you are trying a
threaded app, how about a simple hello world application

Signature

Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc

>I meant to say that I'm using separate threads to read from stdout and
> stderr.  I'm not doing anything with stdin right now.  If anyone can help
[quoted text clipped - 19 lines]
>> each one waiting until the previous one is done.  How exactly can I do
>> that?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.