Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenbauer authored Aug 6, 2024
1 parent b7eba21 commit 32af800
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# StableTasks.jl

StableTasks is a simple package with one main API `StableTasks.@spawn` (not exported by default).
StableTasks is a simple package that provides *type stable* tools for creating (regular and *sticky*) tasks. It has the following API (no exports):

* `StableTasks.@spawn`
* `StableTasks.@spawnat`
* `StableTasks.@fetch`
* `StableTasks.@fetchfrom`

## `StableTasks.@spawn`

It works like `Threads.@spawn`, except it is *type stable* to `fetch` from.

Expand All @@ -22,7 +29,9 @@ Stacktrace:
@ REPL[3]:1
```

The package also provides `StableTasks.@spawnat` (not exported), which is similar to `StableTasks.@spawn` but creates a *sticky* task (it won't migrate) on a specific thread.
## `StableTasks.@spawnat`

The package also provides `StableTasks.@spawnat`, which is similar to `StableTasks.@spawn` but creates a *sticky* task (that won't migrate) on a specific thread.

```julia
julia> t = StableTasks.@spawnat 4 Threads.threadid();
Expand All @@ -31,7 +40,9 @@ julia> @inferred fetch(t)
4
```

For convenience, and similar to at Distributed.jl, there are also `@fetch` and `@fetchfrom` macros:
## `StableTasks.@fetch` and `StableTasks.@fetchfrom`

For convenience, and similar to at Distributed.jl, we also provide `@fetch` and `@fetchfrom` macros:

```julia
julia> StableTasks.@fetch 3+3
Expand Down

0 comments on commit 32af800

Please sign in to comment.