mariadb/libmysqld
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
..
examples MWL#55 : cherrypick MySQL 5.5 CMake/build improvements in order 2011-01-29 18:51:12 +01:00
CMakeLists.txt MWL#192: Non-blocking client API for libmysqlclient. 2011-09-20 12:49:25 +02:00
emb_qcache.cc Fixed build warning on Windows (emb_qcache.cc) 2008-07-10 14:41:56 -06:00
emb_qcache.h Bug#44521 Prepared Statement: CALL p() - crashes: `! thd->main_da.is_sent' failed et.al. 2009-07-30 00:44:04 +02:00
embedded_priv.h pluggable auth with plugin examples 2010-03-29 17:13:53 +02:00
lib_sql.cc Merge with MariaDB 5.1 2011-05-03 19:10:10 +03:00
libmysqld.c pluggable auth with plugin examples 2010-03-29 17:13:53 +02:00
libmysqld.def Fix Windows embedded warnings 2011-05-10 18:18:25 +02:00
libmysqld.rc query_id and my_xid -> ulonglong 2005-01-27 22:38:56 +01:00
Makefile.am MWL#192: Non-blocking client API for libmysqlclient. 2011-09-20 12:49:25 +02:00
resource.h query_id and my_xid -> ulonglong 2005-01-27 22:38:56 +01:00