I tried to do it with simple threads, but I believe that using Threadpool is more effective Can I:)? Simple Thread:
The public static class getLogFile implies Runnabel {Private string file; Public Zero Set filename (string namefile) {file = namefile; } Public Intona 1 (string filemanat) {connected towers (XXX, filename, XXX, XXX, XXX, XXX); // creates a file and downloads it 0; } Public Zero Run () {run1 (file); } }
in main: for (x = 0; x <36; x ++) {string filename 1 = file Name + x; GetLogFileN = new getLogFile (); N.setFilename (Filename1); (New thread (n)). Start (); }
Connects to the program server 36 commands (using threads / soundthreads ?!) runs at the same time and either 36 merging files Can download, or maybe it can just write one file on the server and then download it?
- How to change this code in Threadpool?
- How to write data in a file from 36 threads?
I can only provide you directions.
To use the thread pool, see How any service exacerger works, any examples from Google will give you enough information. See as an example:
36 About writing files in your file, or writing in a file I can not say anything about writing from multiple threads in the same file, but if you finish writing all the threads then you can use CyclicBarrier to wait for the event. Here's an example you can use to:
Comments
Post a Comment