… | |
… | |
87 | either do nothing or result in a runtime error). |
87 | either do nothing or result in a runtime error). |
88 | |
88 | |
89 | BERKELEYDB FUNCTIONS |
89 | BERKELEYDB FUNCTIONS |
90 | All of these are functions. The create functions simply return a new |
90 | All of these are functions. The create functions simply return a new |
91 | object and never block. All the remaining functions all take an optional |
91 | object and never block. All the remaining functions all take an optional |
92 | callback as last argument. If it is missing, then the fucntion will be |
92 | callback as last argument. If it is missing, then the function will be |
93 | executed synchronously. |
93 | executed synchronously. In both cases, $! will reflect the return value |
|
|
94 | of the function. |
94 | |
95 | |
95 | BDB functions that cannot block (mostly functions that manipulate |
96 | BDB functions that cannot block (mostly functions that manipulate |
96 | settings) are method calls on the relevant objects, so the rule of thumb |
97 | settings) are method calls on the relevant objects, so the rule of thumb |
97 | is: if its a method, its not blocking, if its a function, it takes a |
98 | is: if its a method, its not blocking, if its a function, it takes a |
98 | callback as last argument. |
99 | callback as last argument. |
… | |
… | |
132 | |
133 | |
133 | db_open (DB *db, DB_TXN_ornull *txnid, octetstring file, octetstring database, int type, U32 flags, int mode, SV *callback = &PL_sv_undef) |
134 | db_open (DB *db, DB_TXN_ornull *txnid, octetstring file, octetstring database, int type, U32 flags, int mode, SV *callback = &PL_sv_undef) |
134 | flags: AUTO_COMMIT CREATE EXCL MULTIVERSION NOMMAP RDONLY READ_UNCOMMITTED THREAD TRUNCATE |
135 | flags: AUTO_COMMIT CREATE EXCL MULTIVERSION NOMMAP RDONLY READ_UNCOMMITTED THREAD TRUNCATE |
135 | db_close (DB *db, U32 flags = 0, SV *callback = &PL_sv_undef) |
136 | db_close (DB *db, U32 flags = 0, SV *callback = &PL_sv_undef) |
136 | flags: DB_NOSYNC |
137 | flags: DB_NOSYNC |
|
|
138 | db_upgrade (DB *db, octetstring file, U32 flags = 0, SV *callback = &PL_sv_undef) |
137 | db_compact (DB *db, DB_TXN_ornull *txn = 0, SV *start = 0, SV *stop = 0, SV *unused1 = 0, U32 flags = DB_FREE_SPACE, SV *unused2 = 0, SV *callback = &PL_sv_undef) |
139 | db_compact (DB *db, DB_TXN_ornull *txn = 0, SV *start = 0, SV *stop = 0, SV *unused1 = 0, U32 flags = DB_FREE_SPACE, SV *unused2 = 0, SV *callback = &PL_sv_undef) |
138 | flags: FREELIST_ONLY FREE_SPACE |
140 | flags: FREELIST_ONLY FREE_SPACE |
139 | db_sync (DB *db, U32 flags = 0, SV *callback = &PL_sv_undef) |
141 | db_sync (DB *db, U32 flags = 0, SV *callback = &PL_sv_undef) |
140 | db_key_range (DB *db, DB_TXN_ornull *txn, SV *key, SV *key_range, U32 flags = 0, SV *callback = &PL_sv_undef) |
142 | db_key_range (DB *db, DB_TXN_ornull *txn, SV *key, SV *key_range, U32 flags = 0, SV *callback = &PL_sv_undef) |
141 | db_put (DB *db, DB_TXN_ornull *txn, SV *key, SV *data, U32 flags = 0, SV *callback = &PL_sv_undef) |
143 | db_put (DB *db, DB_TXN_ornull *txn, SV *key, SV *data, U32 flags = 0, SV *callback = &PL_sv_undef) |
… | |
… | |
360 | db_sequence_open $seq, undef, "seq", BDB::CREATE; |
362 | db_sequence_open $seq, undef, "seq", BDB::CREATE; |
361 | db_sequence_get $seq, undef, 1, my $value; |
363 | db_sequence_get $seq, undef, 1, my $value; |
362 | |
364 | |
363 | SUPPORT FUNCTIONS |
365 | SUPPORT FUNCTIONS |
364 | EVENT PROCESSING AND EVENT LOOP INTEGRATION |
366 | EVENT PROCESSING AND EVENT LOOP INTEGRATION |
|
|
367 | $msg = BDB::strerror [$errno] |
|
|
368 | Returns the string corresponding to the given errno value. If no |
|
|
369 | argument is given, use $!. |
|
|
370 | |
365 | $fileno = BDB::poll_fileno |
371 | $fileno = BDB::poll_fileno |
366 | Return the *request result pipe file descriptor*. This filehandle |
372 | Return the *request result pipe file descriptor*. This filehandle |
367 | must be polled for reading by some mechanism outside this module |
373 | must be polled for reading by some mechanism outside this module |
368 | (e.g. Event or select, see below or the SYNOPSIS). If the pipe |
374 | (e.g. Event or select, see below or the SYNOPSIS). If the pipe |
369 | becomes readable you have to call "poll_cb" to check the results. |
375 | becomes readable you have to call "poll_cb" to check the results. |
… | |
… | |
556 | |
562 | |
557 | In short: the parent will, after a short pause, continue as if fork had |
563 | In short: the parent will, after a short pause, continue as if fork had |
558 | not been called, while the child will act as if BDB has not been used |
564 | not been called, while the child will act as if BDB has not been used |
559 | yet. |
565 | yet. |
560 | |
566 | |
|
|
567 | Win32 note: there is no fork on win32, and perls emulation of it is too |
|
|
568 | broken to be supported, so do not use BDB in a windows pseudo-fork, |
|
|
569 | better yet, switch to a more capable platform. |
|
|
570 | |
561 | MEMORY USAGE |
571 | MEMORY USAGE |
562 | Per-request usage: |
572 | Per-request usage: |
563 | |
573 | |
564 | Each aio request uses - depending on your architecture - around 100-200 |
574 | Each aio request uses - depending on your architecture - around 100-200 |
565 | bytes of memory. In addition, stat requests need a stat buffer (possibly |
575 | bytes of memory. In addition, stat requests need a stat buffer (possibly |