Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
3.91/5 (3 votes)
See more:
I'm trying to right VB.NET code to create backups of several databases.
The backup-procedure (already written) asks for server, databasename and backup-filename, and returns a string ("Success" or "Error") after backup has been made.

Because each backup can take several minutes, and because the databases can be located on different servers, it is better to create the backups in separated threads.

I already know how to work with multiple threads, and how to wait for all threads to finish, but how can I pass the arguments of server, database en filename to the thread, and how can I read the return-string ?

Thanks already !
Posted

You can use events, parametrized thread-starts and other multi-threading techniues offered by .NET
 
Share this answer
 
One way would be to write a class that wraps a thread. The class would have member properties for the input and output fields and would expose enough of the Thread object to enable synchronization and control. The thread main method would be a member of the class and so would have access to the instance properties.

Nick
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900