Click here to Skip to main content
14,970,219 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I am creating an application where i am moving files from one directory to another, where i have a function which process moving files.

My problem is i have four directories where i want to process my function to move files parallelly
by perfoming multithreading process but my function is performing one by one directory.

Please help me out with this situation

Thank you.
Posted

1 solution

Set up a BackgroundWorker thread for each directory - they can share the same code, provided they don't affect any UI elements directly, and only use parameters and local variables (not class level variables: you would need locking for that).

The MSDN page on BackgroundWorker includes a simple example: http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx[^]
   

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