Z
zqy29
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TFrm_Main.N101Click(Sender: TObject);
var
MMS_Create: TMMSPorduce;
SendStr: string;
Loglst: TStringList;
CliSkt: TClientSocket;
ClientTrd: TClientThread;
i, SendTimes: integer;
MMS_Out: TMMS_Out;
begin
SendTimes := StrToIntDef(Edit1.Text, 0);
for i := 1 to SendTimesdo
begin
MMS_Out.AuthID := 'xxxxxxxxx';
MMS_Out.TransActionID := 'xxxxxxxxx'
MMS_Out.MMSAction := 'xxxxxxxxx';
MMS_Out.SenderAddress := 'xxxxxxxxx';
MMS_Out.ChargedPartyID := 'xxxxxxxxx';
MMS_Out.DestPhone := 'xxxxxxxxx';
MMS_Out.Cc := '';
MMS_Out.Bcc := '';
MMS_Out.Submit := 'xxxxxxxxx';
MMS_Out.SendPath := 'xxxxxxxxx';
try
CliSkt := GetNewClient;
CliSkt.Active := True;
except
AddInfoToMemo('连接服务器@' + RemoteIP + ':' + IntToStr(RemotePort) + '@失败');
Sleep(1000);
Continue;
end;
try
MMS_Create := TMMSPorduce.Create;
SendStr := MMS_Create.MMSEncode(MMS_Out);
with FThreadList.LockListdo
begin
if Count <
50 then
begin
Loglst := TStringList.Create;
ClientTrd := TClientThread.Create(false, MMS_Out, SendStr, FThreadList, CliSkt, Loglst);
Add(ClientTrd);
end
else
begin
FThreadList.UnlockList;
CliSkt.Free;
Continue;
end;
end;
FThreadList.UnlockList;
finally
MMS_Create.Free;
end;
end;
end;
当并发量达到并超过控制数量50时,则出现程序死锁的现象,这又是为何呢?
var
MMS_Create: TMMSPorduce;
SendStr: string;
Loglst: TStringList;
CliSkt: TClientSocket;
ClientTrd: TClientThread;
i, SendTimes: integer;
MMS_Out: TMMS_Out;
begin
SendTimes := StrToIntDef(Edit1.Text, 0);
for i := 1 to SendTimesdo
begin
MMS_Out.AuthID := 'xxxxxxxxx';
MMS_Out.TransActionID := 'xxxxxxxxx'
MMS_Out.MMSAction := 'xxxxxxxxx';
MMS_Out.SenderAddress := 'xxxxxxxxx';
MMS_Out.ChargedPartyID := 'xxxxxxxxx';
MMS_Out.DestPhone := 'xxxxxxxxx';
MMS_Out.Cc := '';
MMS_Out.Bcc := '';
MMS_Out.Submit := 'xxxxxxxxx';
MMS_Out.SendPath := 'xxxxxxxxx';
try
CliSkt := GetNewClient;
CliSkt.Active := True;
except
AddInfoToMemo('连接服务器@' + RemoteIP + ':' + IntToStr(RemotePort) + '@失败');
Sleep(1000);
Continue;
end;
try
MMS_Create := TMMSPorduce.Create;
SendStr := MMS_Create.MMSEncode(MMS_Out);
with FThreadList.LockListdo
begin
if Count <
50 then
begin
Loglst := TStringList.Create;
ClientTrd := TClientThread.Create(false, MMS_Out, SendStr, FThreadList, CliSkt, Loglst);
Add(ClientTrd);
end
else
begin
FThreadList.UnlockList;
CliSkt.Free;
Continue;
end;
end;
FThreadList.UnlockList;
finally
MMS_Create.Free;
end;
end;
end;
当并发量达到并超过控制数量50时,则出现程序死锁的现象,这又是为何呢?