History log of /fuchsia/zircon/system/ulib/async/README.md
Revision Date Author Comments
# 39a67dc8 05-Aug-2018 Doug Evans <dje@google.com>

[ulib][async] Add support for exception ports

Tested: runtests
[which includes new tests for the new functionality]

Change-Id: Ib8eaf30eb2d9abf3f3ca72a0d77450ea52151149


# fabb8fe6 04-Jul-2018 David Moore <davemoore@google.com>

[async] Change async_t -> async_dispatcher_t

Change name of dispatcher type from async_t to async_dispatcher_t
Keep typedef of async_t for compatibility

Change async_{get,set}_default() to async_{get,set}_default_dispatcher()
Again, keep compatible apis until other layers have been modified to use
new api.

Bug:ZX-2337
Test:CQ
Change-Id: If0b5d061fd114d60e23078dbb5f2a6ed9ed6f6cc


# 7a223aed 25-Jun-2018 Ian McKellar <ianloic@google.com>

[async] Fix documentation typo

The example doesn't match the actual API.

TEST=none

Change-Id: I7c53aa4797324e75f24c5c6fe0e47973f7b84842


# d0e16eb4 16-Apr-2018 Joshua Seaton <joshuaseaton@google.com>

[async][docs] Fix links in libasync documentation.

Change-Id: I8f565b0e6c91fc724c5dd8ae0af66721a78bb562


# 89d2b24d 10-Apr-2018 Jeff Brown <jeffbrown@google.com>

[async] Tidy up the libasync API futher.

Deleted WaitWithTimeout since it is no longer used.
Removed flags and reserved storage.
Removed return code from wait handler.
Removed *_or_report_error variants after further consideration.
Deleted the non-RAII variants of the C++ wrappers; these wrappers
might as well be safe to use. Clients desiring minimum overhead
can use the C API instead if they prefer.
Made the C++ wrappers more systematic; each one has a fbl::Function
and a Method based variant.
Added a C++ wrapper for Tasks which takes a no-arg closure.
Improved consistency across all async operations, including docs.
Ported all programs to the new API as required.
Beefed up the tests.

Change-Id: I97beca26cec6d94fa7efd282c8d2620cdbcb84e5


# 2485acfa 06-Apr-2018 Jeff Brown <jeffbrown@google.com>

[async] Tidy up the libasync API for tasks and receivers.

Remove flags fields and reserved storage.
Make the C++ wrappers friendlier.
Move the ops invokers into libasync.a itself in preparation for
adding versioning to the ops structure.
Add *_or_report_error() function variants which make it easier
to systematically handle errors while posting tasks or
enqueuing packets.
Removed the return value from task handlers to reduce confusion
around the lifetime of the task structure and remove an
unusual error handling scenario in case of a failure to
schedule a task to be repeated.
Pass the Task* to the handler for consistency with the C API.
Added some missing static library dependencies.
Reduce use of libfbl (except fbl/function.h).
Remove uses of private inheritance.

Change-Id: I7ccea5b68d6bccb2c7a236d112428c9b17fe8cdd


# 76df15cb 04-Apr-2018 Jeff Brown <jeffbrown@google.com>

[async] Move async-loop implementation to its own directory.

People keep getting confused by the relationship between async-loop
and the rest of the library. So let's fix it.

This change includes compatibility includes for loop.h to be removed
after upper layers are fixed to use the new paths.

Change-Id: I95c57be533fbd91468275bb2470890a4f10101eb


# fa67e541 08-Mar-2018 James Robinson <jamesr@google.com>

[async] Move async headers to match naming rules

The naming rules for C/C++ header files that are extensively used but
not part of the 'system headers' or 'global headers' as defined by
https://fuchsia.googlesource.com/docs/+/master/development/languages/c-cpp/naming.md#include-paths
states that the include lines for headers in the 'async' library should
be spelled like this:

<lib/async/dispatcher.h>

This moves the header files from system/ulib/async/include/async/dispatcher.h
to system/ulib/async/include/lib/async/dispatcher.h and updates
includes to match.

Change-Id: I85de9f17d67605d59df763be54715a1f2aa9ed77


# 6282af39 06-Feb-2018 Alhaad Gokhale <alhaad@google.com>

[async][readme] Fix C++ helper path in async/README.md

Change-Id: I4b931c98a5667c34a204469056eb0e06a02bcf49


# 9ce8d11e 10-Jan-2018 Mark Seaborn <mseaborn@google.com>

[async] Add async::WaitMethod, a lower-overhead version of async::Wait

Example usage of async::Wait:

class Foo {
Foo() { wait_.set_handler(fbl::BindMember(this, &Foo::Handle)); }
async_wait_result_t Handle(...) { ... };
async::Wait wait_;
};

With async::WaitMethod, that becomes:

class Foo {
async_wait_result_t Handle(...) { ... };
async::WaitMethod<Foo, &Foo::Handle> wait_{this};
};

When async::Wait is used with fbl::BindMember() like that, a single
callback from the event loop to Foo::Handle() will involve 3 indirect
jumps plus 1 conditional jump (which generates a lot of wrapper code):

* An indirect jump to async::Wait::CallHandler().
* An indirect jump to fbl::function's virtual operator().
* A conditional jump to check whether &Foo::Handle is a virtual or
non-virtual method. (This is part of the semantics for C++ method
pointers.)
* An indirect jump to the Foo::Handle().

In contrast, async::WaitMethod<> will do only a single indirect jump,
and no conditional jumps. (The conditional jump is avoided because
the callback method &Foo::Handle is passed as a template parameter and
it is known statically to be non-virtual.)

Change-Id: Id581b39eb9939d97148529e5f3453243c72bafc0


# f3e2126c 12-Sep-2017 Roland McGrath <mcgrathr@google.com>

[zx] Magenta -> Zircon

The Great Renaming is here!

Change-Id: I3229bdeb2a3d0e40fb4db6fec8ca7d971fbffb94


# 04058351 11-Sep-2017 Jeff Brown <jeffbrown@google.com>

[async] Amend readme to mention auto_wait and auto_task.

Change-Id: Iec7f13b21658e1b973a67e27a1b1976ec32add42


# 56fa14eb 06-Sep-2017 Jeff Brown <jeffbrown@google.com>

[async] Add RAII helpers for waits and tasks.

This makes the API a bit more convenient to use.

Fixed an inconsistency in the handling of cancelation errors.
We were previously checking for MX_ERR_BAD_STATE which can't happen
during cancelation.

Fixed some minor formatting inconsistencies introduced by the
mxtl->fbl rename.

Added some clarification around thread-safety.

Change-Id: If273a42eea2b869d63c79e47782c28fade339c92


# 59e644b1 07-Sep-2017 George Kulakowski <kulakowski@google.com>

[zircon][mxtl->fbl] Rename mxtl to fbl

Change-Id: Ie21b6498e1bfb0a7fa0315e40b9e5c3ee78646be


# 2bfe671b 05-Sep-2017 Jeff Brown <jeffbrown@google.com>

[async] Use mxtl::Function<> instead of subclassing ops.

Now that we have mxtl::Function<> we can make the asynchronous operation
wrappers much more convenient to use in C++ by using a callback style
interface rather than subclassing.

The runtime performance characteristics should be essentially identical
due to how mxtl::Function<> works.

Change-Id: Id96d0e888b27187c3f0caaeed897d43172df3911


# d7d1e4e8 05-Sep-2017 Jeff Brown <jeffbrown@google.com>

[async] Split async.h into multiple headers and use mxtl/macros.h.

Change-Id: I00d6a2479b0ebee467c73ac16f7c1c2533d9379c


# c350e3aa 18-Aug-2017 Jeff Brown <jeffbrown@google.com>

[async] Split libasync into three parts.

Previously we built libasync as a shared library but that's not
quite correct. The client and message loop implementations should
be static libraries. It's only the default dispatcher functions
that need to be shared.

So we split the library into three parts: libasync.a, libasync-loop.a,
and libasync-default.so.

This also saves the linker some trouble since many clients of libasync
only need libasync.a and not the other parts.

Also improved the docs in a few areas to ensure we cover the C++ API
more thoroughly.

Change-Id: I98702dab4dfc21cbce87b8acddfc046a449410e6


# 5c659b74 24-May-2017 Jeff Brown <jeffbrown@google.com>

[libasync] An asynchronous dispatch library.

The library defines an interface for asynchronously waiting on signals,
posting delayed tasks, or queuing packets on a port.

The library includes a thread-safe message loop based implementation of
this interface which can be used out of box. Clients can also write
their own dispatchers as long as they conform to the interface defined
by |async_ops_t|. Moreover, multiple dispatchers may coexist within
the same process.

This abstraction is intended to decouple clients which require asynchronous
dispatch from the specific implementation details of any particular
dispatcher.

Change-Id: I8cb107437d29ce5acd7093dee6ed1c6ce3779392