How to sync multiple functions / routines in parallel

Glen Bojsza gbojsza at gmail.com
Sat Apr 23 13:32:03 EDT 2011


The database and application are on the same system so this is a plus.

I like the idea of sending 2 queries because for several queries the results
will be a know number returned (ie I want the top 5 or top 10 results) so
this can possibly solve 50% of the queries.

When using revdatafromquery you identify the connectionID so I guess if I
open 5 separate database connections and send queries to all of them at the
same time I know that the database can handle multiple simultaneous queries
through multiple connections so the remaining question is: is there some
form of limitation by rev / livecode with this approach?



On Sat, Apr 23, 2011 at 11:15 AM, Mike Bonner <bonnmike at gmail.com> wrote:

> Might be able to do this with a cgi. Use load with callback to send all
> your
> requests, when the load is complete, process the results, unload, and
> resend.
>
> Another thought.. if the database is local (maybe even it its not local),
> might be able to use open process, and use a command line client to process
> your database queries.
>
> Finally, while probably a bad idea, if you're using revdatafromquery, I
> just
> tried "SELECT * FROM apps; SELECT * FROM users" sending 2 queries with 1
> call and it returned the data from both correctly, and of course in the
> order they were listed. Still sequential, but sequential handled by the db
> engine, not rev. Depending on size of datasets and complexity of query,
> might be something to look at. Another potential problem with this method
> is
> the results will all be strung together so you'll have to be able to sort
> them out yourself.  Only tried it on super simple sqlite db so mileage may
> vary lots
>
> On Sat, Apr 23, 2011 at 10:18 AM, <gbojsza at gmail.com> wrote:
>
> > I don't know if this is true or not...any database or rev support people
> > out there?
> > -----Original Message-----
> > From: Andre Garzia <andre at andregarzia.com>
> > Sender: use-livecode-bounces at lists.runrev.com
> > Date: Sat, 23 Apr 2011 12:36:22
> > To: How to use LiveCode<use-livecode at lists.runrev.com>
> > Reply-To: How to use LiveCode <use-livecode at lists.runrev.com>
> > Subject: Re: How to sync multiple functions / routines in parallel
> >
> > Glen,
> >
> > Doing parallel queries will not work from LiveCode since RevExecuteSQL
> and
> > friends are blocking I think. Your first query will block the engine
> until
> > it returns right?
> >
> > Andre
> >
> > On Sat, Apr 23, 2011 at 12:12 PM, Glen Bojsza <gbojsza at gmail.com> wrote:
> >
> > > Hello,
> > >
> > > I have a database which I have created several queries for doing
> archival
> > > reports.
> > >
> > > Now I would like to have all the queries update the reports
> automatically
> > > every 10 seconds.
> > >
> > > From what I determined I will need to keep the database connections
> open
> > > while the application is running but I cannot do sequential queuing of
> > the
> > > queries because by the time the last query runs it will be out of sync
> > with
> > > the earliest query.
> > >
> > > So, what is the best method to have all queries update every 10 seconds
> > in
> > > parallel? Each query will have it's own database connection that is
> open.
> > >
> > > For anyone not doing databases this could be a similar problem in
> nature
> > > where one needs to have multiple events for gaming occur in parallel...
> I
> > > have not tried programming any games or anything else surrounding this
> > type
> > > of parallism.
> > >
> > > thanks,
> > >
> > > Glen
> > > _______________________________________________
> > > use-livecode mailing list
> > > use-livecode at lists.runrev.com
> > > Please visit this url to subscribe, unsubscribe and manage your
> > > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > >
> >
> >
> >
> > --
> > http://www.andregarzia.com All We Do Is Code.
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the Use-livecode mailing list