From 11db63e86810887411553c9184353763c5c40b73 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 2 Jun 2021 08:46:05 -0700 Subject: fixes #1428 Clarify disallowed operations in AIO completion callbacks --- docs/man/nng_aio_alloc.3.adoc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/man/nng_aio_alloc.3.adoc b/docs/man/nng_aio_alloc.3.adoc index 66e53457..3a4a95e1 100644 --- a/docs/man/nng_aio_alloc.3.adoc +++ b/docs/man/nng_aio_alloc.3.adoc @@ -1,6 +1,6 @@ = nng_aio_alloc(3) // -// Copyright 2018 Staysail Systems, Inc. +// Copyright 2021 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // This document is supplied under the terms of the MIT License, a @@ -33,6 +33,12 @@ It will be called with the argument _arg_. NOTE: The callback _callb_ must not perform any blocking operations, and must complete its execution quickly. If _callb_ does block, this can lead ultimately to an apparent "hang" or deadlock in the application. +This also means you should avoid operations such as allocating new objects, +which also means opening or closing sockets, dialers, and so forth. + +TIP: If more complex or blocking work needs to be performed by _callb_, a separate +thread can be used, along with a xref:nng_cv_alloc.3.adoc[condition variable] +which can be signaled by the callback. Asynchronous I/O operations all take an xref:nng_aio.5.adoc[`nng_aio`] handle such as allocated by this function. -- cgit v1.2.3-70-g09d2