Hi,

   I would want to use the sqlite database in my usb-ethernet(TCP/IP)
converter. It should be utmost realtime. I would like check the state of
converter via www. I write test application, if it is usable. But I
encounter a problem.

   The first process selects configuration from databases, than reads data
  from my usb device and stores them into the database file. The second
process only selects the data and prints them out. The problem is in that,
that the second process doesn't "view" all changes made by the first
process.


First process psedocode:

   while (true) {
     c = sql("select count(*) from t1");

     sql("select cfg from t1");

     for (i = 0; i < c; i++) {
       cfg = sql_step();
       data[i] = read_usb(cfg);
     }

     sql_finalize(); // select

     for (i = 0; i < c; i++) {
       sql("begin exclusive");

       sql("update t1 data");
       sql_finalize(); //update

       sql("commit");
     }
   }


Second process pseudocode:

   while (true) {
     sql("select data from t1");

     printf(data);

     sql_finalize(); // select

     sql_sleep(1);
   }


Thank you for your recommendations, how to optimize this concept.



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to