No, this isn't the problem, read the whole thread. I have to send
several commands to the server in each method (hundreds of method) and
the method can't continue until the answer has been received. Imagine
a kind of database server:

SQLExecute("select ....") -> call to the server and waiting answer
while SQLMoreRecords

SQLExecute("select ....") -> call to the server and waiting answer

wend.

SQlExecute -> call to the server and waiting answer
SQLSelect -> call to the server and waiting answer

... and so on....


> There is no more waiting loop:
>
> 1. user clicks <send> button (or whatever)
> 2. disable interface
> 3. send query
> 4. the dataAvailable event does its thing and gathers the complete
> result
> 5. when it's sure it has all data it displays it (or whatever is done
> with the data)
> 6. enable your interface
>
> Marc
>
> On Apr 19, 2007, at 12:19 PM, Guillermo wrote:
>
> > I have no problem disabling the interface while I wait for the result,
> > the problem is how not eat a lot CPU cycles doing nothing in the
> > waiting loop.
> >
> >      Guillermo
> >
> >
> > 2007/4/19, Marc (aliacta.com) <[EMAIL PROTECTED]>:
> >> I guess the ultimate workaround is simply to disable the whole
> >> interface, windows and menus, while you wait for the result...
> >>
> >> Marc
> >>
> >> On Apr 19, 2007, at 10:33 AM, Guillermo wrote:
> >>
> >>> 2007/4/19, Marc (aliacta.com) <[EMAIL PROTECTED]>:
> >>>>> Ask Marc at Aliacta .... it can be done but it's a fair bit of
> >>>>> work.
> >>>>
> >>>> Yeah... a substantial amount of work...
> >>>>
> >>>> If I understand Guillermo, the way pgSQL4RB works isn't what he
> >>>> wants
> >>>> though.  He literally wants no code execution while waiting for a
> >>>> result, yet without wasting CPU.
> >>>
> >>> Exactly, I need something like the "WaitNextEvent" in the old Mac OS
> >>> API but for Socket, that waits for a Socket Event without
> >>> trashing CPU
> >>> time.
> >>>
> >>> I have my app nearly finished but consumes a lot of CPU waiting for
> >>> packets, this is a big problem on laptops running on battery power.
> >>>
> >>> I don't know if would be possible to use semaphores for this
> >>> matter, I
> >>> tried it sometime ago but I didn't find  a reliable method.
> >>>
> >>>         Guillermo
> >>> _______________________________________________
> >>> Unsubscribe or switch delivery mode:
> >>> <http://www.realsoftware.com/support/listmanager/>
> >>>
> >>> Search the archives:
> >>> <http://support.realsoftware.com/listarchives/lists.html>
> >>
> >> _______________________________________________
> >> Unsubscribe or switch delivery mode:
> >> <http://www.realsoftware.com/support/listmanager/>
> >>
> >> Search the archives:
> >> <http://support.realsoftware.com/listarchives/lists.html>
> >>
> > _______________________________________________
> > Unsubscribe or switch delivery mode:
> > <http://www.realsoftware.com/support/listmanager/>
> >
> > Search the archives:
> > <http://support.realsoftware.com/listarchives/lists.html>
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>
>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to