Asynchronous Workflows and Parallel FX - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Asynchronous Workflows and Parallel FX

Description:

Demonstration of calling a web service synchronously and asynchronously using workflows ... [.NET Thread 11]Get Data For: Antimony [.NET Thread 11]Get Data For: Argon ... – PowerPoint PPT presentation

Number of Views:29
Avg rating:3.0/5.0
Slides: 18
Provided by: robertpi
Category:

less

Transcript and Presenter's Notes

Title: Asynchronous Workflows and Parallel FX


1
Asynchronous Workflows and Parallel FX
2
Calling Web Service using Asynchronous Workflows
3
Calling Web Services
  • Demonstration of calling a web service
    synchronously and asynchronously using workflows
  • This demonstration will analyse
  • Changes in the code required
  • How the results are effected
  • How is performance effected

4
Asynchronous Workflows and Web Services
  • Synchronous

let getAtoms() let pt new
PeriodicTableWS.periodictable() let atoms
pt.GetAtoms() let atoms getNodeContentsList
atoms "/NewDataSet/Table/ElementName"
atoms
  • Asynchronous

let getAtoms async let pt new
PeriodicTableWS.periodictable() let!
atoms pt.GetAtomsAsync() let atoms
getNodeContentsList atoms
"/NewDataSet/Table/ElementName"
return atoms
5
Where did the Async Come From?
  • The programmer must add these to the web service
    proxies

type PeriodicTableWS.periodictable with
member ws.GetAtomsAsync()
Async.BuildPrimitive(ws.BeginGetAtoms,
ws.EndGetAtoms)
type PeriodicTableWS.periodictable with
member ws.GetAtomicWeighAsync(s)
Async.BuildPrimitive(s,
ws.BeginGetAtomicWeight,
ws.EndGetAtomicWeight)
6
Demo
  • Calling a web service

7
Interpreting the Results
Asynchronous .NET Thread 1Get Element Data
List .NET Thread 6Got 112 Elements .NET Thread
11Get Data For Actinium .NET Thread 11Get
Data For Aluminium .NET Thread 10Get Data For
Americium .NET Thread 11Get Data For
Antimony .NET Thread 11Get Data For
Argon ... .NET Thread 6Actinium 227 .NET
Thread 6Aluminium 26.9815 .NET Thread
6Americium 243 .NET Thread 6Antimony
121.75 .NET Thread 6Arsenic 74.9216 .NET
Thread 6Astatine 210 ...
Synchronous .NET Thread 1Get Element Data
List .NET Thread 1Got 112 Elements .NET Thread
1Get Data For Actinium .NET Thread 1Actinium
227 .NET Thread 1Get Data For Aluminium .NET
Thread 1Aluminium 26.9815 .NET Thread 1Get
Data For Americium .NET Thread 1Americium
243 .NET Thread 1Get Data For Antimony .NET
Thread 1Antimony 121.75 .NET Thread 1Get Data
For Argon .NET Thread 1Argon 39.948 .NET
Thread 1Get Data For Arsenic ... ...
8
The Timings
9
Option Pricing using Parallel FX Futures
10
What is Parallel FX?
  • A library currently under development that
    provides
  • Data Parallelism
  • Task Parallelism
  • A common work scheduler
  • Last release was December 2007 CTP

11
What is Options Pricing?
  • An Option is finical contract that gives the
    right, but not the obligation, to buy something
  • Option Pricing is calculating the current value
    of an option contact
  • ... but dont worry about the details this
    provides computational work that needs
    parallelizing

12
What is a Future?
  • Future is a Task that calculates a result

13
Evolution of the Code
  • Synchronous programming
  • Improving responsiveness using BackgroundWorker
  • Work queuing using Futures

14
Evolution of the GUI
  • Old style GUI shows one set of parameters and
    result
  • Queuing style GUI shows all parameters and
    results

15
Demo
  • Pricing an option

16
Summary
  • Asynchronous Workflows Tackle working with
    asynchronous programming model
  • Parallel FX Tackles data and task based
    concurrency

17
Resources
  • Asynchronous Workflows
  • http//www.infoq.com/articles/pickering-fsharp-wor
    kflow
  • http//www.strangelights.com/blog/
  • http//blogs.msdn.com/dsyme
  • Parallel FX
  • http//msdn2.microsoft.com/en-us/concurrency/defau
    lt.aspx
  • http//www.bluebytesoftware.com/blog/Default.aspx
Write a Comment
User Comments (0)
About PowerShow.com