How to manage resources in thread without blocking main GUI thread ?
-
I have application which collect data from resource using thread.
This collected data i am showing on main GUI thread.
i want to know
-
how to manage resources in thread so that it will not block the main GUI thread ?
-
how to manage resources into thread so that it can not cause the crash ?
-
how to send collected data of thread to main gui thread ?
i have seen that my data collection thread is causing the random crash.
-
-
I have application which collect data from resource using thread.
This collected data i am showing on main GUI thread.
i want to know
-
how to manage resources in thread so that it will not block the main GUI thread ?
-
how to manage resources into thread so that it can not cause the crash ?
-
how to send collected data of thread to main gui thread ?
i have seen that my data collection thread is causing the random crash.
- Why should resources handled in another thread block the UI thread?
- As silly as it may sound: write correct code
- As most of the time with Qt: using signals/slots
"i have seen that my data collection thread is causing the random crash" - as always in such situation: use debugger to get the stack trace and see where exactly it is crashing.
-
-
- Why should resources handled in another thread block the UI thread?
- As silly as it may sound: write correct code
- As most of the time with Qt: using signals/slots
"i have seen that my data collection thread is causing the random crash" - as always in such situation: use debugger to get the stack trace and see where exactly it is crashing.
for 2nd point. my thread is collect the multiple command response in this thread if i use mutex lock then it can miss the other commands from resource.
So in this type of situation what is better way to mange response commands in collection thread.
i know the threading. but i not know how manage the resources. for that which concept help so it not block or crash.
-
for 2nd point. my thread is collect the multiple command response in this thread if i use mutex lock then it can miss the other commands from resource.
So in this type of situation what is better way to mange response commands in collection thread.
i know the threading. but i not know how manage the resources. for that which concept help so it not block or crash.
@Qt-embedded-developer Sorry, but you're not providing enough information and not showing any code - how is anybody supposed to know why it does not work?
I also don't know why you need mutexes in that other thread? If you use signals/slots to exchange data with main thread there is no need for any mutexes. -
@Qt-embedded-developer Sorry, but you're not providing enough information and not showing any code - how is anybody supposed to know why it does not work?
I also don't know why you need mutexes in that other thread? If you use signals/slots to exchange data with main thread there is no need for any mutexes.@jsulm Its lots of line code. but i can provide summary:
there is one system which connected with multiple sensors.
this system connected to other system. which shows the data.
so other system is using mutex because it has one part where it has to check sensors connection is there or or not.
as well as this system has to update collected sensors data on to screen.
so this connection checking and collection of data happening from separate 2 thread and using one resource.
-
@jsulm Its lots of line code. but i can provide summary:
there is one system which connected with multiple sensors.
this system connected to other system. which shows the data.
so other system is using mutex because it has one part where it has to check sensors connection is there or or not.
as well as this system has to update collected sensors data on to screen.
so this connection checking and collection of data happening from separate 2 thread and using one resource.
@Qt-embedded-developer said in How to manage resources in thread without blocking main GUI thread ?:
so other system is using mutex because it has one part where it has to check sensors connection is there or or not
What do you mean by "system"? Other application? Other thread? ...?