Parallel Programming with C# and .NET Core
eBook - ePub

Parallel Programming with C# and .NET Core

Developing Multithreaded Applications Using C# and .NET Core 3.1 from Scratch

Rishabh Verma

Compartir libro
  1. English
  2. ePUB (apto para móviles)
  3. Disponible en iOS y Android
eBook - ePub

Parallel Programming with C# and .NET Core

Developing Multithreaded Applications Using C# and .NET Core 3.1 from Scratch

Rishabh Verma

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

Learn, understand, and code parallel programs with confidence using C# 8 and.NET Core 3.0 Key Features

  • Explore and work with the new features and enhancements in.NET Core 3.0 & C# 8
  • Understand the fundamentals of parallel programming
  • Learn various threading patterns and synchronization constructs
  • Build concurrent applications using C# and.Net Core 3.0 from the ground up
  • Understand the principles of unit testing and debugging in concurrent applications

  • Description
    Application development has evolved over the last decade, and with the advent of the latest technologies like Angular, React on client-side, and ASP.NET Core, Spring on the server-side, the consumer expectations have risen like never before. The primary objective of this book is to help readers understand the importance of asynchronous programming and various ways it can be achieved using.NET Core 3.1 and C# 8 to successfully build concurrent applications. Along the way reader will learn the fundamentals of threading, asynchronous programming, various asynchronous patterns, synchronisation constructs, unit testing parallel methods, debugging enterprise applications, and cool tips and tricks.
    There are samples based on practical examples that will help the reader effectively use parallel programming. By the end of this book, you will be equipped with all the knowledge needed to understand, code, and debug multithreaded, concurrent and parallel programs with confidence. What You Will Learn
  • Understand the internals of async/await.
  • Learn how to build applications using async/await.
  • Write unit tests for asynchronous methods.
  • Explore various debugging techniques for enterprise applications.

  • Who this book is for
    Beginners and intermediate developers who build enterprise applications using.NET Core platform and tools. Advanced users can also use this book for brushing up fundamentals and for learning debugging tools, techniques, tips, and tricks. Table of Contents
    1. Getting Started
    2. What's new in C# 8?
    3..NET Core 3.1
    4. Demystifying Threading
    5. Parallel Programming
    6. The Threading Patterns
    7. Synchronization Constructs
    8. Unit Testing Parallel and Asynchronous Programs
    9. Debugging and Troubleshooting ( Its spelling is incorrect in pdf)
    10. Tips and Tricks About the Authors
    Rishabh Verma is a Microsoft certified professional and works at Microsoft as a senior development consultant, helping the customers to design, develop, and deploy enterprise-level applications. An electronic engineer by education, he has 12+ years of hardcore development experience on the.NET technology stack. He is passionate about creating tools, Visual Studio extensions, and utilities to increase developer productivity. His interests are.NET Compiler Platform (Roslyn), Visual Studio Extensibility, code generation, and.NET Core. Neha Shrivastava is a Microsoft certified professional and works as a software engineer for the Cloud & AI group at Microsoft India Development Center. She has about 10 years' development experience and has expertise in the financial, healthcare, and e-commerce domains. Neha did her bachelor's in electronics engineering. Ravindra Akella works as a Senior Consultant at Microsoft with more than 13 years of software development experience. Specializing in.NET and web-related technologies, his current role involves end to end ownership of products right from architecture to delivery.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Parallel Programming with C# and .NET Core un PDF/ePUB en línea?
Sí, puedes acceder a Parallel Programming with C# and .NET Core de Rishabh Verma en formato PDF o ePUB, así como a otros libros populares de Ciencia de la computación y Programación paralela. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2020
ISBN
9789389423327

CHAPTER 1

Getting Started

“The secret to getting ahead is getting started!”
- Anonymous
As the name of chapter states, we will set up the required tools and get started with our journey of parallel programming with .NET Core 3.1 and C# 8. There are essential framework and tools to be downloaded and installed to start our learning and practical implementation on .NET Core 3.1 using windows operating system. We will begin the journey with the installation of Visual Studio 2019 and the latest version of .NET Core 3.1. We will create our first .NET Core 3.1 application. Though .NET Core 3.1 is cross-platform, we will focus the discussion on Windows as that’s the most popular and widely used operating system platform on the planet. So, let’s get started.

Structure

We will cover the following topics:
  • Download essential tools for Windows
  • Installing Visual Studio 2019 with .NET Core 3.1
  • PerfMon
  • ProcMon
  • Proc exe
  • PerfView
  • JustDecompile
  • DebugDiag
  • WinDbg
  • Create your first .NET Core 3.1 application using Visual Studio 2019
  • Summary
  • Exercise

Objective

By the end of this chapter, the reader would:
  • Learn to download and install all the required tools for .NET Core 3.1 and C# 8
  • Create a “Hello World” application using .NET Core 3.1 template using Visual Studio 2019
  • Learn to set up the development, debugging, troubleshooting and monitoring tools

Download essential tools for Windows

In this section, we will discuss the prerequisites. To have a seamless experience in learning .NET Core 3.1, we need to download and install a few developer tools. Microsoft recommends the Visual Studio Integrated Development Environment (IDE) to develop programs for Android, iOS, Windows applications, mobile applications, web applications, websites, web services, and cloud.
Navigate to the URL https://visualstudio.microsoft.com/%20downloads/ in your preferred browser. Microsoft gives us options to select from 4 Visual Studio variations:
  • Community:Powerful IDE, free for students, open-source contributors, and individuals, open-source contributors, and individuals
  • Professional: Professional IDE best suited to small teams
  • Enterprise:Scalable, end-to-end solution for teams of any size
  • Code: The fast, free and open-source code editor that adapts to your needs
We can download one of these depending on our choice and description stated above. These descriptions are taken as-is from the download site. However, depending upon the selected option, you may or may not have features described in this book, like time travel debugging, and so on. For pure development purposes and following the code snippets and samples of this book, Visual Studio 2019 Community version would suffice. The great thing is that this version is free. However, if it is possible for the reader, I would recommend Visual Studio 2019 Enterprise as it has a great set of tools and features for developing an enterprise-grade application. The authors of this book use Visual Studio 2019 Enterprise for code development and demonstration of tools.
We can go through Release Notes of each of the variants available to us to know more about them. Every variant and its small description are available on the above site:
Figure 1.1: Download Visual Studio 2019
Visual Studio Code (VS Code): Apart from Community, Professional, and Enterprise variants of Visual Studio 2019, Microsoft provides a free open source code editor Visual Studio Code. It is a cross-platform code editor, and apart from Windows, VS code works with Linux and Mac OS. It’s a cross-platform editor that can be extended with extensions available based on our requirements, for example, C# extension. It includes provision for embedded Git control, debugging, syntax highlighting, snippets, intelligent code completion, extensions support, and code refactoring.
Note: Visual Studio Code, like notepad, is an editor, and Visual Studio is an IDE. So Visual Studio Code is very lightweight, fast, with great support for debugging and has embedded Git control. It is a file and folders-based editor and doesn’t need to know the project context, unlike an IDE. There is no File | New Project support in Visual Studio Code as we have in Visual Studio IDE. Instead, Visual Studio Code has a terminal, through which we can run .NET commands.
Apart from Visual Studio 2019, we are going to use few more tools in upcoming chapters like PerfMon for performance monitoring and troubleshooting, ProcMon tool for process monitoring, PerfView for performance analysis, and many more. We will see them in action in Chapter 9, Debugging and Troubleshooting.

Installing Visual Studio 2019 with .NET Core 3.1

For coding in Windows, as we discussed above, we can use:
  • Visual Studio 2019 IDE
  • Visual Studio Code editor
If we choose Visual Studio 2019, we just need to download Visual Studio 2019 version 16.4 or higher from https://visualstudio.microsoft.com/vs/. Visual Studio 2019 version 16.4 is the latest at the time of writing this chapter. It may change by the time; this book gets published. It comes with .NET Core 3.1 SDK and its project templates. So, we will be ready for development immediately after installing it.
Here I am installing Visual Studio Enterprise 2019. In workloads section, select .NET Core cross-platform development:
Figure 1.2: Select .NET Core cross-platform development workload
You can select additional workloads based on your needs. For this book, we need .NET Core cross-platform development, so we selected it and performed the installation. With this workload selected, the rest of the steps are straight forward, and the installation can be done without any issues.
Next, we will investigate other tools that we shall be using during this book. Let’s start with the tool that comes installed by default in Windows Enterprise or Pro version of the operating system.

Perfmon

  1. Perfmon, which is an acronym for performance monitoring, is the Windows reliability and performance monitoring tool. It helps us to troubleshoot the issues, including application level to the hardware level. To open perfmon, go to Run (press Windows key + R), type perfmon, and then click the OK button:
    Figure 1.3: Open perfmon through Run or by ...

Índice