1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 <2012> 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 <2012> 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: ca_flush_io and threads |
From: | Dirk Zimoch <[email protected]> |
To: | [email protected] |
Cc: | [email protected] |
Date: | Mon, 12 Mar 2012 10:56:52 +0100 |
Hi Michael,If you have "third party" threads that have to work with CA, e.g. call ca_flush_io(), it is necessary that they join the main CA context. Otherwise they will start their own unrelated context.
Get a context handle from the main thread with ca_current_context() after calling ca_context_create(). Then in your third party thread, call ca_attach_context() with that context handle.
Dirk [email protected] wrote:
I've just discovered that ca_flush_io() only appears to have an effect on IO requests generated by the calling thread and calling ca_flush_io() from an unrelated thread appears to be a no-op. Is this deliberate? I can't see any hint of this behaviour in the documentation, which uses the simple phrase "Flush outstanding IO requests to the server." I was expecting the effect to be process wide.