Skip to content

Commit f40ee34

Browse files
committed
Describe the project and its first steps.
1 parent 5cc4192 commit f40ee34

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Grand Central Dispatch
2+
3+
Grand Central Dispatch (GCD or libdispatch) provides comprehensive support for concurrent code execution on multicore hardware.
4+
5+
libdispatch is currently available on all Darwin platforms. This project aims to make a modern version of libdispatch available on all other Swift platforms. To do this, we will implement as much of the portable subset of the API as possible, using the existing open source C implementation.
6+
7+
## Project Goals
8+
9+
We are currently very early in the development of this project. Our starting point is simply a mirror of the open source drop that corresponds with OS X El Capitan (10.11). Therefore, our earliest goals are:
10+
11+
0. Build and test the C source code as a dynamic library on the current Swift Linux targets (Ubuntu 14.04 and Ubuntu 15.10).
12+
0. Add a `module.modulemap` and make the libdispatch API importable into Swift.
13+
0. After the previous two steps are done, consider possible improvements to the interface of the libdispatch API in Swift.
14+
15+
## Building a C Library
16+
17+
libdispatch on Darwin is a combination of logic in the `xnu` kernel alongside the user-space Library. The kernel has the most information available to balance workload across the entire system. As a first step, however, we believe it is useful to bring up the basic functionality of the library using user-space pthread primitives on Linux.
18+
19+
Our first tasks for this project are:
20+
21+
0. Develop a makefile or other build script for the project on Linux. The current build system is focused on Darwin.
22+
0. Omit as much of the extra functionality of the library as possible, to get a core version of the project building. Much of the OS X-specific functionality can be elided completely on Linux.
23+
0. Adopt libdispatch in other Core Libraries projects, especially Foundation. This will validate our work and get immediate coverage on basic functionality.
24+
0. Incrementally add functionality back in.
25+
26+
Some C headers and sources (e.g. `Availability.h`, `Block.h`, and the libclosure `runtime.c`) are similar to ones embedded into the CoreFoundation part of [swift-corelibs-foundation](http://github.com/apple/swift-corelibs-foundation). We should figure out a mechanism to share these instead of duplicating them across projects.

0 commit comments

Comments
 (0)