You are looking at historical revision 33102 of this page. It may differ significantly from its current revision.

pthreads

Maintain and talk to a pthread pool.

Overview

Most of the egg's work is done in the startup: a pool of pthreads waiting for a job is initialized.

Issues

API

C

[syntax] typedef int (*C_pthread_request_function_t)(void *);
[procedure] extern int start_asynchronous_request(C_pthread_request_function_t function, void *data, void *callback);

Scheme

[procedure] (pool-send! JOB DATA CALLBACK) -> undefined

All arguments given as non-null-c-pointer.

JOB: The C procedure to call

DATA: Opaque pointer for parameter passing.

CALLBACK: Pointer to callback procedure. Typically a C_GC_ROOT.

Examples

       (define sqlite3-start-prepare
         (foreign-lambda*
          void
          ((<sqlite3-prepare-args> s) (nonnull-c-pointer callback))
          "start_asynchronous_request(
            pthread_sqlite3_prepare, s, callback);"))

About this egg

Author

Jörg F. Wittenberger

Source Code

The pthreds egg repository is maintained on github.

License

BSD