• unknown's avatar
    MWL#192: Non-blocking client API for libmysqlclient. · a5b88159
    unknown authored
    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 ...
    a5b88159
check_async_queries.pl 2.23 KB