Define Asynchronous programming techniques with examples of async/ wait functions.

 Asynchronous programming techniques

  • Asynchronous programming in C# is an efficient approach towards activities blocked or access is delayed.
  • If an activity is blocked in a synchronous then, the complete application waits and it takes more time. By using the asynchronous approach the applications continue with other ' tasks as well.'
  • The async and await keywords in C# are used in async programming. Using them, we can work with .Net resources, .Net Core, etc.

Example:

using System;

using System. Threading. Tasks;

namespace My Console App

{

 Class Async Await Test 

{

 Static void Main (string [ ]args)

{

 Method1(); 

Method 2(); 

Console. ReadKey ();

public static async Task Method1()

await Task.Run(() => 

{

 for(int & i= 0; i ≤ 100; i++) 

Console Write Line ("Methed 1");

}

});

}

 public static void Method 2 

{

 for (int i=0; i <25, i++)

{

Console.WriteLine (Method 2"); 

}

}

}

}

Comments

Popular posts from this blog

Suppose that a data warehouse for Big-University consists of the following four dimensions: student, course, semester, and instructor, and two measures count and avg_grade. When at the lowest conceptual level (e.g., for a given student, course, semester, and instructor combination), the avg_grade measure stores the actual course grade of the student. At higher conceptual levels, avg_grade stores the average grade for the given combination. a) Draw a snowflake schema diagram for the data warehouse. b) Starting with the base cuboid [student, course, semester, instructor], what specific OLAP operations (e.g., roll-up from semester to year) should one perform in order to list the average grade of CS courses for each BigUniversity student. c) If each dimension has five levels (including all), such as “student < major < status < university < all”, how many cuboids will this cube contain (including the base and apex cuboids)?

Describe how cloud computing technology can be applied to support remote ECG monitoring.

Explain market-Oriented Cloud computing architecture.