Why the software deadlock?(tpicshow)

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

Why the software deadlock?(tpicshow)

Postby guan_2000 » September 16th, 2006, 6:00 am

I use the control tpicshow now. Version : 4.03 .The software will deadlock in the individual computer when "threaded" is true.
Particularly new computer .I have more than 800 customers
in the use of software products . More than 30 users Software will deadlock.If i Set up parameters of "threaded" false, The software would not deadlock.
All the computer of deadlock happened is purchased recently .
Who can help me? :cry:
guan_2000
Member
Member
 
Posts: 4
Joined: September 16th, 2006, 5:11 am

Postby Kambiz » September 16th, 2006, 1:53 pm

You have to re-check your code of the control's event handlers. Probably they are not thread-safe.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby guan_2000 » September 16th, 2006, 4:25 pm

thank you very much!
I have no writed code of the control's event handlers.
I writed a control nameed TMCtrlPicText, the control Contains tpicshow.
my part of code:
Code: Select all
type
  TMCtrlPicText = class(TPanel)
  private
    { Private declarations }
    FFlash: TShockwaveFlash;  //in deadlock testing ,assign the nill
    FRxGif: TRxGIFAnimator;   //in deadlock testing ,assign the nill
    FPicShow: TPicShow;
    FMovie: TActiveMovie;     //in deadlock testing ,assign the nill
    ...
    ...

procedure TMCtrlPicText.Open(aContainer: TElementContainer; wait: boolean; timeset: integer);
begin
...
        FPicShow := TPicShow.Create(self);
        FPicShow.Parent := self;
        FPicShow.Width := Width;
        FPicShow.Height := Height;
        FPicShow.Left := 0;
        FPicShow.Top := 0;
        FPicShow.Visible := false;
...
end;

destructor TMCtrlPicText.Destroy;
begin
   ...
    FPicShow.Free;
    inherited;
    ...
end;

procedure TMCtrlPicText.Play;
begin
     ...
            FPicShow.Picture.Assign(TMPicText(FContainer.ElementList.Objects[FCurBusyElement]).GetBitmap);
            Randomize;
            FPicShow.Style := Random(170);
            FPicShow.Execute;
            Invalidate;
           SetTimer(Handle,1,50,nil);
    ...
end;

procedure TMCtrlPicText.TimerTick(var Msg: TMessage);
begin
    ...
    if FPicShow.Busy then
    ...
    //check the control whether the 'busy' is false.If the 'busy' is false,my control is 'free'.

end;

the master code creat my control on-line ,waiting...,free,
Next the master line creat the control on-line again,assign another the value,plots the above process.

//Mod - Added code tags[/code]
guan_2000
Member
Member
 
Posts: 4
Joined: September 16th, 2006, 5:11 am

Postby Kambiz » September 17th, 2006, 1:52 pm

Instead of checking PicShow's status using a timer, try to use OnStop event of the control. When OnStop event is raised, start a timer to release your object after a short delay.

Also, after executing PicShow, you do not need to call Invalidate.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby guan_2000 » September 20th, 2006, 6:13 am

In fact,after i check the control's 'busy' is false,the timer delay 5 seconds for picture display, then,my control is 'free'.
guan_2000
Member
Member
 
Posts: 4
Joined: September 16th, 2006, 5:11 am

Postby guan_2000 » April 11th, 2007, 2:10 am

After five months,now,i have found the reason of deadlock.when tpichsow's visible is false, FPicShow.Execute,the software will deadlock.
in my code, the picshow's parent is tpanel.I first ' FPicShow.Execute',next 'the panel.visible:=true',so some new hight speed computers will deadlock.
thanks Kambiz.
guan_2000
Member
Member
 
Posts: 4
Joined: September 16th, 2006, 5:11 am

Postby Kambiz » April 18th, 2007, 12:49 pm

Thank you very much for clarifying the problem. I'll try to fix it in the next release.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 2 guests

cron