Loading ...
Sorry, an error occurred while loading the content.

Re: Event progamming, application do not stop

Expand Messages
  • tailuo2002
    Fb don t stop at all. I think FB can t do it. ... an ... use ... current
    Message 1 of 23 , Jun 1, 2006
    • 0 Attachment
      Fb don't stop at all. I think FB can't do it.

      --- In firebird-support@yahoogroups.com, "Dimitry Sibiryakov"
      <SD@...> wrote:
      >
      > On 11 Mar 2006 at 7:49, tailuo2002 wrote:
      >
      > >When working on synchronous mode ,I think if no event occurs, the
      > >application shoud stop at isc_wait_for_event() and suspend. After
      an
      > >event occurs, the application then continues running.
      >
      > IB (and FB) events work a bit different from your ideas. They
      use
      > "counters". First call of isc_wait_for_event() deliver to you
      current
      > values of counters and thus return immediatelly. Subsequent calls
      > will wait for events to really happen.
      >
      > >isc_wait_for_event();
      > // get current counters
      > isc_wait_for_event();
      > >// stop here, dont'return until any event notifications arrive.
      > // and then get me new counters
      > >
      > >printf("I'm here! \n");
      >
      > --
      > SY, Dimitry Sibiryakov.
      >
    • tailuo2002
      Which OS are you using? I m usging Linux.
      Message 2 of 23 , Jun 1, 2006
      • 0 Attachment
        Which OS are you using? I'm usging Linux.

        --- In firebird-support@yahoogroups.com, "Dimitry Sibiryakov" <SD@...>
        wrote:
        >
        > On 1 Jun 2006 at 7:01, tailuo2002 wrote:
        >
        > >Fb don't stop at all. I think FB can't do it.
        >
        > Wanna a bet? I really use events and they work.
        >
        > --
        > SY, Dimitry Sibiryakov.
        >
      • Dimitry Sibiryakov
        ... Wanna a bet? I really use events and they work. -- SY, Dimitry Sibiryakov.
        Message 3 of 23 , Jun 1, 2006
        • 0 Attachment
          On 1 Jun 2006 at 7:01, tailuo2002 wrote:

          >Fb don't stop at all. I think FB can't do it.

          Wanna a bet? I really use events and they work.

          --
          SY, Dimitry Sibiryakov.
        • Dimitry Sibiryakov
          ... Windows is here. But FB API is platform-independent. Show me your code. -- SY, Dimitry Sibiryakov.
          Message 4 of 23 , Jun 1, 2006
          • 0 Attachment
            On 1 Jun 2006 at 7:37, tailuo2002 wrote:

            >Which OS are you using? I'm usging Linux.

            Windows is here. But FB API is platform-independent. Show me your
            code.

            --
            SY, Dimitry Sibiryakov.
          • tailuo2002
            char *event_buffer, *result_buffer; long blength; ISC_STATUS status_vector[20]; my_connect_db(); my_start_tran(); blength = isc_event_block(&event_buffer,
            Message 5 of 23 , Jun 3, 2006
            • 0 Attachment
              char *event_buffer, *result_buffer;
              long blength;
              ISC_STATUS status_vector[20];

              my_connect_db();
              my_start_tran();

              blength = isc_event_block(&event_buffer, &result_buffer,1, "abc");

              isc_wait_for_event(status_vector,&SMSDB,(short)blength,event_buffer,
              result_buffer);

              printf("Event coming here.\n");


              --- In firebird-support@yahoogroups.com, "Dimitry Sibiryakov" <SD@...>
              wrote:
              >
              > On 1 Jun 2006 at 7:37, tailuo2002 wrote:
              >
              > >Which OS are you using? I'm usging Linux.
              >
              > Windows is here. But FB API is platform-independent. Show me your
              > code.
              >
              > --
              > SY, Dimitry Sibiryakov.
              >
            • Dimitry Sibiryakov
              ... And? This is exactly what I told earlier: first call of isc_wait_for_event() will immediatelly return you current value(s) of counter(s). Next call of
              Message 6 of 23 , Jun 4, 2006
              • 0 Attachment
                On 3 Jun 2006 at 11:11, tailuo2002 wrote:

                >
                > char *event_buffer, *result_buffer;
                > long blength;
                > ISC_STATUS status_vector[20];
                >
                > my_connect_db();
                > my_start_tran();
                >
                > blength = isc_event_block(&event_buffer, &result_buffer,1, "abc");
                >
                > isc_wait_for_event(status_vector,&SMSDB,(short)blength,event_buffer,
                >result_buffer);
                >
                > printf("Event coming here.\n");

                And? This is exactly what I told earlier: first call of
                isc_wait_for_event() will immediatelly return you current value(s) of
                counter(s). Next call of isc_wait_for_event() will actually wait for
                event to happen.

                --
                SY, Dimitry Sibiryakov.
              • tailuo2002
                ... I tried calling isc_wait_for_event twice, but it didn t help. I have removed FB 1.5.2 and installed FB 1.5.3, no changes happened.
                Message 7 of 23 , Jun 5, 2006
                • 0 Attachment
                  --- In firebird-support@yahoogroups.com, "Dimitry Sibiryakov" <SD@...>
                  wrote:
                  >
                  > On 3 Jun 2006 at 11:11, tailuo2002 wrote:
                  >
                  > >
                  > > char *event_buffer, *result_buffer;
                  > > long blength;
                  > > ISC_STATUS status_vector[20];
                  > >
                  > > my_connect_db();
                  > > my_start_tran();
                  > >
                  > > blength = isc_event_block(&event_buffer, &result_buffer,1, "abc");
                  > >
                  > > isc_wait_for_event(status_vector,&SMSDB,(short)blength,event_buffer,
                  > >result_buffer);
                  > >
                  > > printf("Event coming here.\n");
                  >
                  > And? This is exactly what I told earlier: first call of
                  > isc_wait_for_event() will immediatelly return you current value(s) of
                  > counter(s). Next call of isc_wait_for_event() will actually wait for
                  > event to happen.
                  >
                  > --
                  > SY, Dimitry Sibiryakov.
                  >


                  I tried calling isc_wait_for_event twice, but it didn't help. I have
                  removed FB 1.5.2 and installed FB 1.5.3, no changes happened.
                • Dimitry Sibiryakov
                  ... Did you use right event buffer for second call of isc_wait_for_event()? -- SY, Dimitry Sibiryakov.
                  Message 8 of 23 , Jun 5, 2006
                  • 0 Attachment
                    On 5 Jun 2006 at 12:56, tailuo2002 wrote:

                    >I tried calling isc_wait_for_event twice, but it didn't help. I have
                    >removed FB 1.5.2 and installed FB 1.5.3, no changes happened.

                    Did you use right event buffer for second call of
                    isc_wait_for_event()?

                    --
                    SY, Dimitry Sibiryakov.
                  • tailuo2002
                    What do you mean right event buffer ? Could you give me an example ? How do you think that I should call isc_wait_for_event twice ? I can t get any anwser
                    Message 9 of 23 , Aug 5, 2006
                    • 0 Attachment
                      What do you mean 'right event buffer' ? Could you give me an example ?

                      How do you think that I should call isc_wait_for_event twice ? I can't
                      get any anwser from the interbase document.



                      Thank you.

                      --- In firebird-support@yahoogroups.com, "Dimitry Sibiryakov" <SD@...>
                      wrote:
                      >
                      > On 5 Jun 2006 at 12:56, tailuo2002 wrote:
                      >
                      > >I tried calling isc_wait_for_event twice, but it didn't help. I have
                      > >removed FB 1.5.2 and installed FB 1.5.3, no changes happened.
                      >
                      > Did you use right event buffer for second call of
                      > isc_wait_for_event()?
                      >
                      > --
                      > SY, Dimitry Sibiryakov.
                      >
                    • Dimitry Sibiryakov
                      ... Buffer, returned by first call of isc_wait_for_events(), filled with initial counters. Something like this: isc_wait_for_event(status_vector, DbCfg,
                      Message 10 of 23 , Aug 6, 2006
                      • 0 Attachment
                        On 5 Aug 2006 at 12:44, tailuo2002 wrote:

                        >What do you mean 'right event buffer' ? Could you give me an example
                        >?

                        Buffer, returned by first call of isc_wait_for_events(), filled
                        with initial counters.

                        Something like this:

                        isc_wait_for_event(status_vector, DbCfg, EventBlockLength,
                        EventBuffer, ResultBuffer));
                        CopyMemory(EventBuffer, ResultBuffer, EventBlockLength);
                        isc_que_events(status_vector, DbCfg, event_id, EventBlockLength,
                        EventBuffer, ast_routine, Self));

                        >How do you think that I should call isc_wait_for_event twice ? I can't
                        >get any anwser from the interbase document.

                        Counters. Events are working through counters. You must get current
                        values somehow.

                        --
                        SY, Dimitry Sibiryakov.
                      • tailuo2002
                        Thank you for your reply. But, did you noticed that isc_que_events is for asynchronous notification ? I want the application code keep waiting synchronously.
                        Message 11 of 23 , Aug 11, 2006
                        • 0 Attachment
                          Thank you for your reply.

                          But, did you noticed that isc_que_events is for asynchronous
                          notification ? I want the application code keep waiting synchronously.


                          --- In firebird-support@yahoogroups.com, "Dimitry Sibiryakov" <SD@...>
                          wrote:
                          >
                          > On 5 Aug 2006 at 12:44, tailuo2002 wrote:
                          >
                          > >What do you mean 'right event buffer' ? Could you give me an example
                          > >?
                          >
                          > Buffer, returned by first call of isc_wait_for_events(), filled
                          > with initial counters.
                          >
                          > Something like this:
                          >
                          > isc_wait_for_event(status_vector, DbCfg, EventBlockLength,
                          > EventBuffer, ResultBuffer));
                          > CopyMemory(EventBuffer, ResultBuffer, EventBlockLength);
                          > isc_que_events(status_vector, DbCfg, event_id, EventBlockLength,
                          > EventBuffer, ast_routine, Self));
                          >
                          > >How do you think that I should call isc_wait_for_event twice ? I can't
                          > >get any anwser from the interbase document.
                          >
                          > Counters. Events are working through counters. You must get current
                          > values somehow.
                          >
                          > --
                          > SY, Dimitry Sibiryakov.
                          >
                        • Dimitry Sibiryakov
                          ... And what prevents you from using isc_wait_for_events() instead of isc_que_events()? Brain fade? -- SY, Dimitry Sibiryakov.
                          Message 12 of 23 , Aug 11, 2006
                          • 0 Attachment
                            On 11 Aug 2006 at 9:52, tailuo2002 wrote:

                            >But, did you noticed that isc_que_events is for asynchronous
                            >notification ? I want the application code keep waiting synchronously.

                            And what prevents you from using isc_wait_for_events() instead of
                            isc_que_events()? Brain fade?

                            --
                            SY, Dimitry Sibiryakov.
                          Your message has been successfully submitted and would be delivered to recipients shortly.