1
0
mirror of https://github.com/MariaDB/server.git synced 2025-05-28 13:01:41 +03:00
unknown a5b881594d MWL#192: Non-blocking client API for libmysqlclient.
All client functions that can block on I/O have alternate _start() and
_cont() versions that do not block but return control back to the
application, which can then issue I/O wait in its own fashion and later
call back into the library to continue the operation.

Works behind the scenes by spawning a co-routine/fiber to run the
blocking operation and suspend it while waiting for I/O. This
co-routine/fiber use is invisible to applications.

For i368/x86_64 on GCC, uses very fast assembler co-routine support. On
Windows uses native Win32 Fibers. Falls back to POSIX ucontext on other
platforms. Assembler routines for more platforms are relatively easy to
add by extending mysys/my_context.c, eg. similar to the Lua lcoco
library.

For testing, mysqltest and mysql_client_test are extended with the
option --non-blocking-api. This causes the programs to use the
non-blocking API for database access. mysql-test-run.pl has a similar
option --non-blocking-api that uses this, as well as additional
testcases.

An example program tests/async_queries.c is included that uses the new
non-blocking API with libevent to show how, in a single-threaded
program, to issue many queries in parallel against a database.


client/async_example.c:
  Fix const warning
  ******
  Fix bug with wrong timeout value for poll().
include/Makefile.am:
  Fix missing include for `make dist`
include/mysql.h:
  Add prototypes for all non-blocking API calls.
include/mysql.h.pp:
  Add prototypes for all non-blocking API calls.
mysys/my_context.c:
  Fix type warning for makecontext() function pointer argument.
sql-common/mysql_async.c:
  Fix crashes in the non-blocking API for functions that can take MYSQL argument
  that is NULL.
tests/Makefile.am:
  Add header file to `make dist`
tests/mysql_client_test.c:
  Replace blocking calls with wrappers around the non-blocking calls, used in
  mysql_client_test to test the new non-blocking API.
tests/nonblock-wrappers.h:
  Replace blocking calls with wrappers around the non-blocking calls, used in
  mysql_client_test to test the new non-blocking API.
2011-09-20 12:49:25 +02:00
..
2010-02-25 23:13:11 +04:00
2009-02-15 12:58:34 +02:00
2010-09-12 18:40:01 +02:00
2010-06-10 11:11:52 +02:00
2009-10-28 09:52:34 +02:00
2009-10-28 09:52:34 +02:00
2009-10-28 09:52:34 +02:00
2011-05-12 16:31:54 +02:00
2011-01-25 12:14:28 +05:30
2009-10-28 09:52:34 +02:00
2011-05-02 20:58:45 +03:00
2010-11-25 00:57:34 +02:00
2009-09-29 17:38:40 +02:00
2010-01-15 17:27:55 +02:00
2011-02-20 18:51:43 +02:00
2011-02-20 18:51:43 +02:00
2011-05-03 19:10:10 +03:00
2009-09-08 00:50:10 +04:00
2010-11-25 00:57:34 +02:00
2009-09-08 00:50:10 +04:00
2010-11-25 00:57:34 +02:00
2011-05-02 20:58:45 +03:00
2011-05-02 20:58:45 +03:00
2011-05-02 20:58:45 +03:00
2009-05-06 15:00:14 +05:30
2009-10-28 09:52:34 +02:00
2011-02-20 18:51:43 +02:00
2009-06-09 15:19:13 +02:00
2009-06-09 15:19:13 +02:00
2010-10-19 15:58:35 +02:00
2010-09-09 21:16:01 -07:00
2011-05-02 20:58:45 +03:00
2011-03-29 10:09:05 +02:00
2010-09-06 02:15:34 +03:00
2010-11-23 23:39:59 +02:00
2011-02-20 18:51:43 +02:00
2009-10-28 09:52:34 +02:00
2009-10-28 09:52:34 +02:00
2010-09-06 02:15:34 +03:00
2009-06-25 02:44:14 +04:00
2011-05-02 20:58:45 +03:00
2010-08-25 22:22:33 +02:00
2011-05-02 20:58:45 +03:00
2011-05-02 20:58:45 +03:00
2009-10-28 09:52:34 +02:00
2009-08-12 12:03:05 +02:00
2010-06-14 18:58:52 +02:00
2010-11-25 00:57:34 +02:00
2011-05-02 20:58:45 +03:00
2009-09-08 00:50:10 +04:00
2009-10-28 09:52:34 +02:00
2011-01-14 02:05:10 -08:00
2010-01-15 10:51:39 +02:00
2009-10-28 09:52:34 +02:00
2011-05-02 20:58:45 +03:00
2009-07-03 10:19:32 +02:00
2009-11-27 18:10:28 +02:00
2010-04-08 14:10:05 +02:00
2010-03-21 21:58:19 +01:00
2009-06-10 11:58:36 +03:00
2011-02-20 18:51:43 +02:00
2011-05-02 20:58:45 +03:00
2009-02-19 18:24:25 -05:00
2010-05-26 21:55:40 +03:00
2010-06-10 11:11:52 +02:00
2011-05-02 20:58:45 +03:00
2011-07-21 11:20:55 +03:00