| Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date | |
| All threads index page 5 | |
Hi, I use thread in my apps to do some time-consuming works, I put all the time-consuming tasks in a queue,and in QThread::run() call them one by one. It in most time work fine,but some times the main GUI will block. I cannot find where it blocks because it happens randoms.Even I catch the GUI block in gdb , I also cannot tell where it blocks because the app still run inside gdb. So how can I find where it blocks? Thanks, Sorry if bad English... -- [ signature omitted ]
jiang jefix wrote: > Hi, > > I use thread in my apps to do some time-consuming works, I put all the > time-consuming tasks in a queue,and in QThread::run() call them one by > one. > It in most time work fine,but some times the main GUI will block. > I cannot find where it blocks because it happens randoms.Even I catch > the GUI block > in gdb , I also cannot tell where it blocks because the app still run > inside gdb. > So how can I find where it blocks? Generic debugging method is: 1. Reproduce the issue 2. Get the coredump using gcore or attach gdb to running process 3. Analyze it 4. Create something like UDP_debug_printf and insert UDP printing to suspicious places. -- [ signature omitted ]
jiang jefix wrote: >Hi, > >I use thread in my apps to do some time-consuming works, I put all the >time-consuming tasks in a queue,and in QThread::run() call them one by >one. >It in most time work fine,but some times the main GUI will block. >I cannot find where it blocks because it happens randoms.Even I catch >the GUI block >in gdb , I also cannot tell where it blocks because the app still run >inside gdb. >So how can I find where it blocks? Switch to the gdb terminal, press Ctrl+C and type: thread apply all backtrace -- [ signature omitted ]
Attachment:
signature.asc
Description: This is a digitally signed message part.