473,397 Members | 2,028 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,397 software developers and data experts.

NEWBIE: Running multiple loops at the same time

I've very much a beginner to VB.NET, and I'm running Visual Basic 2005 Express. Anyways, all I'd like to do is run three concurrent Do loops at the same time. Is this at all possible?
Mar 15 '07 #1
5 2260
tylerb
8
I've very much a beginner to VB.NET, and I'm running Visual Basic 2005 Express. Anyways, all I'd like to do is run three concurrent Do loops at the same time. Is this at all possible?
I assume you mean loops that aren't nested

this:
do{
something
}
do{
something
}
do{
something
}

rather than:
do{
do{
do{
}
}
}

If you are then you will have to lookup how to fork a process or create a multi-threaded application. You should be able to find some resources about either of those. Let me know if you have problems or have no idea what I am talking about.
Mar 15 '07 #2
Three nested loops in VB would look something like this:

Expand|Select|Wrap|Line Numbers
  1.         Do While someCondition1
  2.             doSomething()
  3.             Do While someCondition2
  4.                 doSomething()
  5.                 Do While someCondition3
  6.                     doSomething()
  7.                 Loop
  8.             Loop
  9.         Loop
Three loops that aren't nested would look something like this:

Expand|Select|Wrap|Line Numbers
  1. Do While someCondition1
  2.      doSomething()
  3. Loop
  4.  
  5. Do While someCondition2
  6.      doSomething()
  7. Loop
  8.  
  9. Do While someCondition3
  10.      doSomething()
  11. Loop
Mar 15 '07 #3
I assume you mean loops that aren't nested

this:
do{
something
}
do{
something
}
do{
something
}

rather than:
do{
do{
do{
}
}
}

If you are then you will have to lookup how to fork a process or create a multi-threaded application. You should be able to find some resources about either of those. Let me know if you have problems or have no idea what I am talking about.
I have looked a bit into multithreading, but I haven't been able to find any resources/tutorials aimed towards really stupid people. If there's something you could recommend, I'd really appreciate it.

Oh, and that first loop example is what I'm attempting to do.
Mar 15 '07 #4
RedSon
5,000 Expert 4TB
Can you post your code snippit of what your loops are going to do. Multi-threading is a big can of worms you probably do not want to get into. It is however the only way to do things "at the same time". Depending on what your loops are doing you might be able to do it with just some clever programming tricks.
Mar 15 '07 #5
Thanks for the help everyone, but I figured out to organize the code differently to achieve the same effect. Thanks!
Mar 17 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Jacek Generowicz | last post by:
I have a multiple disptacher which, conceptually, looks something like this: class Multimethod: def __init__(self): self.methods = {}
1
by: MyHaz | last post by:
What is the running time of conactination on character strings. i.e. >> joe="123" >> joe+="99999999999999999" is it Amortized Constant time? I don't think it would be O((number of...
1
by: Knocked Wood | last post by:
Hi, I looked around and can't find anything on this at all and can not get it to work for IE. I'm trying to loop multiple sounds on a game, with three unique variables, when a link is clicked....
5
by: john | last post by:
Hello, I am trying to send 2^19 data to USB2.0. I am reading the file "all_sines" and loading it into an array called "string1". Then, in a for loop I copied it into the USB data array...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
6
by: Fabian Vilers | last post by:
Hi all, I'm my script I've three loops processing a very huge data file. IE & Firefox show a message box after some time saying my script could be infinite looping and give me a chance to stop...
4
by: Matt Ratliff | last post by:
Hello, I would appreciate any assistance you have with the following problem: I have (as an example) an array of values as follows: arrayvalues=new Array("0001","0003","0005") where each is the...
37
by: bahoo | last post by:
Hi, I have a list like and as output I want If I myList.remove('0024') then only the first instance of '0024' is removed.
13
by: Joel Koltner | last post by:
Is there an easy way to get a list comprehension to produce a flat list of, say, for each input argument? E.g., I'd like to do something like: for x in range(4) ] ....and receive
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.