From shiwei.zhang at oracle.com Tue Jul 1 06:55:43 2008 From: shiwei.zhang at oracle.com (shiwei zhang) Date: Tue, 01 Jul 2008 18:55:43 +0800 Subject: [ruby-oci8-devel] Support FAN in Ruby-OCI8 In-Reply-To: <5d847bcd0806291537k7c3520adyffb2fbeb7aec3b94@mail.gmail.com> References: <47622312.8070500@oracle.com> <47906414.1040904@oracle.com> <5d847bcd0801180151u1d6f787fqad5f937fde6c2e65@mail.gmail.com> <47947ADD.5050701@oracle.com> <47FF2128.8060300@oracle.com> <5d847bcd0804262210p377740d9xad2bddd2c6ba6fbe@mail.gmail.com> <4817EE43.3060200@oracle.com> <481D4611.20408@oracle.com> <481F65F5.2010804@oracle.com> <4864A773.1010505@oracle.com> <5d847bcd0806291537k7c3520adyffb2fbeb7aec3b94@mail.gmail.com> Message-ID: <486A0D2F.60806@oracle.com> Hi Kubo, KUBO Takehiro wrote: > Hi, > > On Fri, Jun 27, 2008 at 5:40 PM, shiwei zhang wrote: > >> Hi, >> >> I've successfully tested the FAN functionality in my environment. The steps >> are as below: >> > > Great! > > >> 3. Make the Ruby-OCI8 linked with a threaded library and make it in >> OCI_EVENT mode. >> > > Is it libpthread? > No, it's a multi-threaded environment created by OCI8 library. The OCI8 will automatically spawn a new thread when necessary (e.g., spawn a listening thread to accept events). It'll be linked with the threaded library if: 1) The Oracle Full Client/Instant Client is 10g or above (I haven't checked whether 9i also supports). 2) The mode "OCI_THREADED" is set up when the program initializes the OCI8 environment. > If a C macro HAVE_NATIVETHREAD is defined, the ruby is configured > with '--enable-pthread' option and is linked with libpthread. > You have no need to link it for oci8lib.so. > > #if HAVE_NATIVETHREAD /* defined in ruby.h */ > ... enable FAN by user configuration... > #else > ... disable FAN ... > #endif > > >> (I worked out a patch to do this but you know for some >> reason currently it's not merged into Ruby-OCI8. ;-) ) >> > > Did you send me the patch? I don't remember it. If it have no problem, > could you commit it by yourself? > No, I haven't sent the patch to you yet :-( . I am finding an appropriate way to submit it to you. Thanks & Best Regards, Shiwei -------------- next part -------------- An HTML attachment was scrubbed... URL: From liming.lian at oracle.com Wed Jul 2 03:51:38 2008 From: liming.lian at oracle.com (Liming Lian) Date: Wed, 02 Jul 2008 15:51:38 +0800 Subject: [ruby-oci8-devel] Macro : RUNTIME_API_CHECK Message-ID: <486B338A.4050307@oracle.com> Hi Kubo, I see the macro "RUNTIME_API_CHECK" many places in Ruby-oci8 c codes. For example, the xmldb.c: #if defined RUNTIME_API_CHECK || ORACLE_CLIENT_VERSION >= 1000 I am wondering what this macro is used for. Any hints? Thanks in advance! Liming From kubo at jiubao.org Wed Jul 2 23:50:10 2008 From: kubo at jiubao.org (KUBO Takehiro) Date: Thu, 3 Jul 2008 12:50:10 +0900 Subject: [ruby-oci8-devel] Macro : RUNTIME_API_CHECK In-Reply-To: <486B338A.4050307@oracle.com> References: <486B338A.4050307@oracle.com> Message-ID: <5d847bcd0807022050i2957933bjb5dbff02cee89b94@mail.gmail.com> Hi, On Wed, Jul 2, 2008 at 4:51 PM, Liming Lian wrote: > Hi Kubo, > > I see the macro "RUNTIME_API_CHECK" many places in Ruby-oci8 c codes. For > example, the xmldb.c: > > #if defined RUNTIME_API_CHECK || ORACLE_CLIENT_VERSION >= 1000 > > I am wondering what this macro is used for. Any hints? The macro is defined when ruby-oci8 is configured with --with-runtime-check cd ruby-oci8 ruby setup.rb config -- --with-runtime-check make If --with-runtime-check is set, the compiled oci8lib.so works with all supported Oracle versions as if it is compiled for the currently used Oracle client library. It checks available OCI functions by using LoadLibrary() and GetProcAddress() (or dlopen() and dlsym() on UNIX). See also: http://ruby-oci8.rubyforge.org/en/dev_APIWrap.html#l1 (I should rewrite this. I cannot understand what I wrote...) -- KUBO Takehoro kubo at jiubao.org