Note that there are some explanatory texts on larger screens.

plurals
  1. POKeeping main thread (Qt Application) responsive while some other thread is processing (POSIX)
    primarykey
    data
    text
    <p>System / software Details : Qt Version 4.7.4</p> <p>Linux Kernel : 2.6.31 (Custom kernel built for IMX25)</p> <p>Peripherals : Graphic LCD (64x128) Quectel (M 12) GPRS module Thermal printer</p> <p>Database : Sqlite3</p> <p>I am a beginner don't have much experience either in Qt or programming with Linux. I have developed an application where user enter some data manually and that data gets saved in sqlite database. So what I am trying to do is that after certain time lets say 90 seconds data from database should get transferred to the server using the GPRS.</p> <p>So I am using the Qt's signal and slots mechanism to do the timed data transfer. I have created a slot which gets fired every 90 seconds and as the slot gets fired I am creating/launching a POSIX thread which is suppose to transfer the data to the server.</p> <p>So what that thread does is it launches the "pppd" and once the "pppd" is up it queries the database for the data and sends the data to the server. And once the data transfer is done I kill the "pppd". The functionality works fine. </p> <p>But the problem is that the "pppd" takes time to launch so I had to introduce some delay. i.e sleep of 12 seconds is there in order to let the pppd launch successfully. But as the sleep is blocking it makes the main program/thread non responsive until the "pppd" is launched (i.e. it halts/stops all the activities like printing etc.). And as the "pppd" is launched the main thread becomes responsive again. </p> <p>So please suggest me some solution in order to keep the main thread responsive when "pppd" is launching or please suggest me if there is any other alternative for the same. Also guide me if there's anything wrong with my approach..</p> <p>Thanks in advance. And I am sorry if I have not followed your standards..</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload