dbTalk Databases Forums  

How to use the DB_ENV->set_thread_id?

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss How to use the DB_ENV->set_thread_id? in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
wuxian610
 
Posts: n/a

Default How to use the DB_ENV->set_thread_id? - 03-19-2006 , 04:04 AM






Hi,

Anyone know the fountions really mean?

"thread_id" founction --> DB_ENV->set_thread_id
"isalive" founction --> DB_ENV->set_isalive

Are they Create the thread we will use? Or they are only used to check
the status of the thread?

How to construct the "thread_id" and "isalive" fouctions?Could anyone
give me an simple example?

Thanks~


Reply With Quote
  #2  
Old   
ubell@sleepycat.com
 
Posts: n/a

Default Re: How to use the DB_ENV->set_thread_id? - 03-21-2006 , 03:23 PM






The thread_id function defaults to the right thing on systems that
support pthread mutexes. So in most cases you need not write your own
version. The thread_id function is only used for notating what thread
created a transaction or holds a mutex and is not required for proper
functioning of the BDB library unless you use the DB_ENV->failchk
interface. The is_alive function is used by the failchk interface to
determine if a thread is still alive. Please see:
http://www.sleepycat.com/docs/api_cxx/env_failchk.html

Michael Ubell
Sleepycat Software.


Reply With Quote
  #3  
Old   
wuxian610
 
Posts: n/a

Default re:How to use the DB_ENV->set_thread_id? - 03-22-2006 , 02:35 AM



Thanks for your reply! Michae,


Reply With Quote
  #4  
Old   
EelBait
 
Posts: n/a

Default Re: How to use the DB_ENV->set_thread_id? - 03-28-2006 , 06:28 PM




ubell (AT) sleepycat (DOT) com wrote:
Quote:
The thread_id function defaults to the right thing on systems that
support pthread mutexes. So in most cases you need not write your own
version. The thread_id function is only used for notating what thread
created a transaction or holds a mutex and is not required for proper
functioning of the BDB library unless you use the DB_ENV->failchk
interface. The is_alive function is used by the failchk interface to
determine if a thread is still alive. Please see:
http://www.sleepycat.com/docs/api_cxx/env_failchk.html

Michael Ubell
Sleepycat Software.
I've looked through the various documentation on set_isalive, and
env_failchk. What I can't seem to figure out is how to write my
is_alive function. I'm using the CDS product with a number of
processes. Are each of them supposed to implement the is_alive function
or is only the process that calls failchk supposed to? Since my
processes are unrelated, is my is_alive suppose to somehow manage my
various processes pids? My processes are kicked off via a web server as
cgi programs. They don't live long.

I looked at DB_REGISTER but that doesn't seem to work for CDS.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.