File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Multithreading-using-parallel-process-in-.NET
Multithreading-using-tasks-in-.NET Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ static void Main(string[] args)
13
13
{
14
14
Console . WriteLine ( "Task {0} started" , count ) ;
15
15
//Create multiple PDF document, one document on each thread.
16
- OpenPDFAndSaveImage ( count ) ;
16
+ ConvertPdfToImage ( count ) ;
17
17
Console . WriteLine ( "Task {0} is done" , count ) ;
18
18
} ) ;
19
19
}
20
20
//Open and save a PDF document using multi-threading.
21
- static void OpenPDFAndSaveImage ( int count )
21
+ static void ConvertPdfToImage ( int count )
22
22
{
23
23
using ( FileStream inputStream = new FileStream ( @"Data/Input.pdf" , FileMode . Open , FileAccess . Read ) )
24
24
{
Original file line number Diff line number Diff line change @@ -12,14 +12,14 @@ public static async Task Main()
12
12
Task [ ] tasks = new Task [ TaskCount ] ;
13
13
for ( int i = 0 ; i < TaskCount ; i ++ )
14
14
{
15
- tasks [ i ] = Task . Run ( ( ) => OpenPDFAndSaveImage ( ) ) ;
15
+ tasks [ i ] = Task . Run ( ( ) => ConvertPdfToImage ( ) ) ;
16
16
}
17
17
//Ensure all tasks complete by waiting on each task.
18
18
await Task . WhenAll ( tasks ) ;
19
19
}
20
20
21
21
//Open a PDF document and save image using multi-threading.
22
- static void OpenPDFAndSaveImage ( )
22
+ static void ConvertPdfToImage ( )
23
23
{
24
24
using ( FileStream inputStream = new FileStream ( @"Data/Input.pdf" , FileMode . Open , FileAccess . Read ) )
25
25
{
You can’t perform that action at this time.
0 commit comments