Skip to content

Commit e3d35eb

Browse files
authored
Update README.md
Added a basic readme (will expand on it later)
1 parent 3e53c64 commit e3d35eb

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1-
# dispatch-queue-cs
1+
# DispatchQueue
2+
3+
A simple implementation of Apple's Grand Central Dispatch in C# with an interest in creating as few allocations as possible.
4+
This implementation also avoids locks where possible.
5+
6+
# Example Code
7+
8+
```C#
9+
// create a serial queue and give it a Thread pool (anything inheriting from IThreadPool, ManagedThreadPool is provided as a default implementation)
10+
SerialQueue queue = new SerialQueue(new ManagedThreadPool());
11+
12+
// push some work to the queue
13+
queue.DispatchAsync(null, (_) =>
14+
{
15+
Console.WriteLine("This is executed on a worker thread");
16+
});
17+
18+
queue.DispatchAsync(null, (_) =>
19+
{
20+
Console.WriteLine("This is also executed on a worker thread");
21+
});
22+
```

0 commit comments

Comments
 (0)