Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Re: Multi-Threading - How Do I Create and Use Threads?


Message #1 by "andy irvine" <andy@i...> on Tue, 16 Apr 2002 10:49:41
Hello List!

OK, I'd like to make my regular VB app into a turbo-charged multi-threaded
app, I understand the first step is to make my project an ActiveX exe.  Any
online examples or code fragments of how to create threads would be great.
Quite simply, I need to do the following...

Function MyFunction_A()

	For i = 0 to 9
		'Create New Thread i
		'Have Thread i Call MyFunction_B(i)
	Next

	'At this point I should have 10 concurrent threads running MyFunction_B(i)

End Funcion

In case it matters, I have a processing function that takes lots of time due
to roundtrip communication overhead between my app and the processing
partner.  If I have each thread grab 1/10th of the records needing to be
processed and run all 10 threads concurrently, I should be able to speed
everything up by about a factor of 10 since the main bottleneck is by far
the roundtrip to process each record.

Thanks List!
-Aaron


  Return to Index