Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » General » Downloads
 
Add your own
alternative version
Go to top

Task Parallel Library: 1 of n

, 17 May 2011
A look into using the Task Parallel Library.
LINQPAD_Task1.zip
Task Parallel Library
01. Creating Tasks.linq
02. Threads vs Tasks.linq
03. Uncaught Exception.linq
04. Handling Exception using Try Catch.linq
05. Handling Exception using Handle Method.linq
06. Handling Exception using the tasks Exception property.linq
07. Canceling task with resource cleanup.linq
08. Canceling single task.linq
09. Canceling one of several tasks.linq
TasksArticle1.zip
TasksArticle1
BlockingOperations
bin
Debug
BlockingOperations.exe
BlockingOperations.pdb
BlockingOperations.vshost.exe
BlockingOperations.vshost.exe.manifest
obj
x86
Debug
BlockingOperations.exe
BlockingOperations.pdb
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Properties
CancellingOneOfSeveralTasks
bin
Debug
CancellingOneOfSeveralTasks.exe
CancellingOneOfSeveralTasks.pdb
CancellingOneOfSeveralTasks.vshost.exe
CancellingOneOfSeveralTasks.vshost.exe.manifest
obj
x86
Debug
CancellingOneOfSeveralTasks.exe
CancellingOneOfSeveralTasks.pdb
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Properties
CancellingSingleTask
bin
Debug
CancellingSingleTask.exe
CancellingSingleTask.pdb
CancellingSingleTask.vshost.exe
CancellingSingleTask.vshost.exe.manifest
obj
x86
Debug
CancellingSingleTask.exe
CancellingSingleTask.pdb
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Properties
CreatingTasks
bin
Debug
CreateTask01.exe
CreateTask01.vshost.exe.manifest
CreatingTasks.exe
CreatingTasks.pdb
CreatingTasks.vshost.exe
CreatingTasks.vshost.exe.manifest
Release
obj
x86
Debug
CreatingTasks.exe
CreatingTasks.pdb
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Properties
HandleUsingExHandle
bin
Debug
HandleUsingExHandle.exe
HandleUsingExHandle.pdb
HandleUsingExHandle.vshost.exe
HandleUsingExHandle.vshost.exe.manifest
obj
x86
Debug
DesignTimeResolveAssemblyReferencesInput.cache
HandleUsingExHandle.exe
HandleUsingExHandle.pdb
TempPE
Properties
HandlingByReadingTaskValues
bin
Debug
HandlingByReadingTaskValues.exe
HandlingByReadingTaskValues.pdb
HandlingByReadingTaskValues.vshost.exe
HandlingByReadingTaskValues.vshost.exe.manifest
obj
x86
Debug
DesignTimeResolveAssemblyReferencesInput.cache
HandlingByReadingTaskValues.exe
HandlingByReadingTaskValues.pdb
TempPE
Properties
HandlingExceptionsUsingTryCatch
bin
Debug
HandlingExceptionsUsingTryCatch.exe
HandlingExceptionsUsingTryCatch.pdb
HandlingExceptionsUsingTryCatch.vshost.exe
HandlingExceptionsUsingTryCatch.vshost.exe.manifest
obj
x86
Debug
DesignTimeResolveAssemblyReferencesInput.cache
HandlingExceptionsUsingTryCatch.exe
HandlingExceptionsUsingTryCatch.pdb
TempPE
Properties
TasksArticle1.suo
ThreadsVersusTasks
bin
Debug
ThreadsVersusTasks.exe
ThreadsVersusTasks.pdb
ThreadsVersusTasks.vshost.exe
ThreadsVersusTasks.vshost.exe.manifest
obj
x86
Debug
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
ThreadsVersusTasks.exe
ThreadsVersusTasks.pdb
Properties
UncaughtExceptionInWinFormsDemoApp
bin
Debug
UncaughtExceptionInWinFormsDemoApp.exe
UncaughtExceptionInWinFormsDemoApp.pdb
UncaughtExceptionInWinFormsDemoApp.vshost.exe
UncaughtExceptionInWinFormsDemoApp.vshost.exe.manifest
obj
x86
Debug
DesignTimeResolveAssemblyReferencesInput.cache
GenerateResource.read.1.tlog
GenerateResource.write.1.tlog
TempPE
UncaughtExceptionInWinFormsDemoApp.exe
UncaughtExceptionInWinFormsDemoApp.Form1.resources
UncaughtExceptionInWinFormsDemoApp.pdb
UncaughtExceptionInWinFormsDemoApp.Properties.Resources.resources
Properties
Settings.settings
WinformsSynchonizationContext
bin
Debug
WinformsSynchonizationContext.exe
WinformsSynchonizationContext.pdb
WinformsSynchonizationContext.vshost.exe
WinformsSynchonizationContext.vshost.exe.manifest
obj
x86
Debug
DesignTimeResolveAssemblyReferencesInput.cache
GenerateResource.read.1.tlog
GenerateResource.write.1.tlog
TempPE
WinformsSynchonizationContext.exe
WinformsSynchonizationContext.Form1.resources
WinformsSynchonizationContext.pdb
WinformsSynchonizationContext.Properties.Resources.resources
Properties
Settings.settings
WPFDispatcherSynchonizationContext
bin
Debug
WPFDispatcherSynchonizationContext.exe
WPFDispatcherSynchonizationContext.pdb
WPFDispatcherSynchonizationContext.vshost.exe
Release
obj
x86
Debug
DesignTimeResolveAssemblyReferencesInput.cache
GenerateResource.read.1.tlog
GenerateResource.write.1.tlog
MainWindow.baml
TempPE
WPFDispatcherSynchonizationContext.exe
WPFDispatcherSynchonizationContext.g.resources
WPFDispatcherSynchonizationContext.pdb
WPFDispatcherSynchonizationContext.Properties.Resources.resources
WPFDispatcherSynchonizationContext_MarkupCompile.cache
WPFDispatcherSynchonizationContext_MarkupCompile.i.cache
Properties
Settings.settings
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{71217801-5945-46CC-AAC0-9C97EEFBC551}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>HandlingByReadingTaskValues</RootNamespace>
    <AssemblyName>HandlingByReadingTaskValues</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Sacha Barber
Software Developer (Senior)
United Kingdom United Kingdom
I currently hold the following qualifications (amongst others, I also studied Music Technology and Electronics, for my sins)
 
- MSc (Passed with distinctions), in Information Technology for E-Commerce
- BSc Hons (1st class) in Computer Science & Artificial Intelligence
 
Both of these at Sussex University UK.
 
Award(s)

I am lucky enough to have won a few awards for Zany Crazy code articles over the years

  • Microsoft C# MVP 2014
  • Codeproject MVP 2014
  • Microsoft C# MVP 2013
  • Codeproject MVP 2013
  • Microsoft C# MVP 2012
  • Codeproject MVP 2012
  • Microsoft C# MVP 2011
  • Codeproject MVP 2011
  • Microsoft C# MVP 2010
  • Codeproject MVP 2010
  • Microsoft C# MVP 2009
  • Codeproject MVP 2009
  • Microsoft C# MVP 2008
  • Codeproject MVP 2008
  • And numerous codeproject awards which you can see over at my blog

You may also be interested in...

| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 18 May 2011
Article Copyright 2011 by Sacha Barber
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid