Changeset 33102 in project


Ignore:
Timestamp:
01/21/16 11:22:03 (4 years ago)
Author:
svnwiki
Message:

Anonymous wiki edit for IP [78.51.40.209]:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/pthreads

    r33094 r33102  
    1 See [[https://github.com/0-8-15/pthreads|documentation]] on github.
     1== pthreads
     2
     3Maintain and talk to a pthread pool.
     4
     5== Overview
     6
     7Most of the egg's work is done in the startup: a pool of {{pthreads}} waiting for a job is initialized.
     8
     9
     10== Issues
     11
     12* Requires recent chicken version 4.11 or at least git master rev. 8294683 of 2016-01-14
     13
     14* Starts currently 5 pthreads. TBD: make this configurable and start as many threads a the operating system configured processors are available.
     15
     16* The Scheme API is not yet tested.
     17
     18
     19== API
     20
     21=== C
     22
     23<macro>typedef int (*C_pthread_request_function_t)(void *);</macro>
     24
     25<procedure>extern int start_asynchronous_request(C_pthread_request_function_t function, void *data, void *callback);</procedure>
     26
     27=== Scheme
     28
     29<procedure>(pool-send! JOB DATA CALLBACK) -> undefined</procedure>
     30
     31All arguments given as non-null-c-pointer.
     32
     33{{JOB}}: The C procedure to call
     34
     35{{DATA}}: Opaque pointer for parameter passing.
     36
     37{{CALLBACK}}: Pointer to callback procedure. Typically a {{C_GC_ROOT}}.
     38
     39== Examples
     40
     41* [[https://github.com/0-8-15/sqlite3pth|sqlite3pth egg repository]] on github.
     42
     43        (define sqlite3-start-prepare
     44          (foreign-lambda*
     45           void
     46           ((<sqlite3-prepare-args> s) (nonnull-c-pointer callback))
     47           "start_asynchronous_request(
     48             pthread_sqlite3_prepare, s, callback);"))
     49
     50* Ask the author for alpha code running fuse on pthreads.
     51
     52== About this egg
     53
     54=== Author
     55
     56Jörg F. Wittenberger
     57
     58=== Source Code
     59
     60The [[https://github.com/0-8-15/pthreads|pthreds egg repository]] is maintained on github.
     61
     62=== License
     63
     64BSD
Note: See TracChangeset for help on using the changeset viewer.