Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #135 use StartImmediateAsTask instead of StartAsTask to prevent a thread hop #191

Merged
merged 2 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions release-notes.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

Release notes:
0.4.x (unreleased)
- overhaul all doc comments, add exceptions info, improve tooltips experience, #136
- DEPRECATED: type 'TaskSeq<'T>' now replaces 'taskSeq<'T>', the latter deprecated FS0044, #187
- BINARY INCOMPATIBLE: TaskSeq module members are now static members, source code compatible, #186
- overhaul all doc comments, add exceptions, improve editor experience, #136
- DEPRECATED: 'taskSeq<_>' renamed to 'TaskSeq<_>', 'taskSeq' warns with FS0044, #187
- BINARY INCOMPATIBILITY: 'TaskSeq' module is now static members on 'TaskSeq<_>', fixes #184
- Performance: less thread hops with 'StartImmediateAsTask' instead of 'StartAsTask', fixes #135

0.4.0-alpha.1
- fixes not calling Dispose for 'use!', 'use', or `finally` blocks #157 (by @bartelink)
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Control.TaskSeq/AsyncExtensions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ module AsyncExtensions =

member _.For(source: TaskSeq<'T>, action: 'T -> Async<unit>) =
source
|> TaskSeq.iterAsync (action >> Async.StartAsTask)
|> TaskSeq.iterAsync (action >> Async.StartImmediateAsTask)
|> Async.AwaitTask
2 changes: 1 addition & 1 deletion src/FSharp.Control.TaskSeq/TaskSeqBuilder.fs
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ module HighPriority =
ResumableTSC<'U>(fun sm ->
let mutable awaiter =
Async
.StartAsTask(computation, cancellationToken = sm.Data.cancellationToken)
.StartImmediateAsTask(computation, cancellationToken = sm.Data.cancellationToken)
.GetAwaiter()

let mutable __stack_fin = true
Expand Down