Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Thread execution causing program to hang


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Sep 18, 2017 3:59 AM Last Post By: Toby Dobbs
Toby Dobbs

Posts: 77
Registered: 9/24/16
Thread execution causing program to hang  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 13, 2017 8:02 AM
Hi,

I have a thread which periodically hides and shows a label so that it appears to be flashing. Elsewhere in my program there is a chart which is plotted cyclically. Each feature works as expected when run exclusively but cause the program to hang when run simultaneously. Only the flashing label is updated via an indpendent thread.

Do you have any information or advice as to how I should solve this issue?
Remy Lebeau (Te...


Posts: 9,448
Registered: 12/23/01
Re: Thread execution causing program to hang  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 13, 2017 8:51 AM   in response to: Toby Dobbs in response to: Toby Dobbs
Toby Dobbs wrote:

I have a thread which periodically hides and shows a label so that it
appears to be flashing.

Why are you using a thread for that, and not a timer?

Each feature works as expected when run exclusively but cause the
program to hang when run simultaneously.

Then you are not doing it correctly. Please show your actual code. Is
your worker thread synchronizing with the main UI thread when updating
the label?

--
Remy Lebeau (TeamB)
Toby Dobbs

Posts: 77
Registered: 9/24/16
Re: Thread execution causing program to hang  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 18, 2017 3:59 AM   in response to: Toby Dobbs in response to: Toby Dobbs
I realised a mistake elsewhere in the code. The thread works fine. Thanks for your help.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02