use of Thread Sleep method in C sharp

Thread.Sleep a method used to suspend current thread for a specific interval of time. Time can be specified in milliseconds. While in a Sleep mode a method does not consumes any CPU resources so indirectly it save memory for other thread processes. On the same we will create a simple example where in the for … Read more

use of Thread Join method in C sharp

Parent Thread execution may terminates before child execution complete. we can use Thread.Join() method to halt the other thread, until the first thread complete its execution . Thread.Join() when attached to any thread, it makes the other thread to execute first and halts other threads. Now on the same we will see an example where … Read more

Anagram program in C Sharp

Anagrams-Two strings are said to be Anagrams of each other if they share the same set of letters to form the respective strings. for example: Dog->god, seat->eats.. Input Please Enter the First String viswanath Please Enter Second String nathviswa Output Strings Viswanath and nathviswa are Anagrams Algorithm: step 1: convert two strings into character arrays … Read more

Synchronous and Asynchronous Threads in C sharp

Synchronous and Asynchronous Threads in C # – Learn how to executes tasks  parallel to minimize the execution time using multithreading. Work or code task always executed in 2 ways 1. Synchronous 2. Asynchronous Synchronous way means where multiple jobs executed one after another. dependency on another work completion is more in synchronous way. work1–>work2–>…. … Read more

convert each alternate character of a string to uppercase and lowercase in C sharp

Convert each alternate character of a string to uppercase and lowercase in c#- Learn how to convert alternate letter in a string to upper and lowercase with  example program.   For example input string is  VISWANATH, After converting the alternate letters to uppercase and lowercase , Then output of the  input string is  vIsWaNaTh   … Read more

Need of Thread in C Sharp

Need of Thread in C# – Learn about process and thread behaviours with explanation and example programs. Before going to learn about thread concept, we will learn about how a process works? Process Program under execution with the operating system instructions is called a process. Each process assigned with separate copy of memory for its … Read more

Creating a Thread in C Sharp

Creating a Thread in C#- Learn what is a thread? and how to create a thread with Explanation and Example programs. Thread– thread is a light weight process that executes the program independently. Thread able to run the program simultaneously with other threads. Multi threading – running more than one thread simultaneously to execute the … Read more