No subject
David Duville
duville____ipanematech.com
Tue Sep 12 09:20:18 CEST 2000
Hi,
I'm new in using AGENT++ 3.4, I thought I read the documentation but one point is still not clear for me is the use of start_synch() .... end_synch() .
I wanted to know how works the ThreadManager start_synch() method.
Does it woks like in Java that is to say all resources accessed beetween start_synch() and end_synch() are locked and reserved by the Thread which is using them and these resouces are release after the bloc or does is works by doing a copy of the resouces what permit other Threads to process requests which came during the execution of the start_synch() .... end_synch() block.
my question is because in my code while updating an EntryView in a table even if I use this block or not I have no error and everything seems to be OK
see my exemple :
....
.....
....
while(fgets(myFileLine,512,iFlowFile)
&& not_time_to_stop(stopEventToMonitor))
{
start_synch ();
sscanf(myFileLine,"%[^|]%c%[^|]%c%[^|]%c%[^|]%c%[^|]%c%[^|]%c%[^|]%c%s",id,&c1,from,&c2,to,&c3,protocol,&c4,application,&c5,direction,&c6,upstream,&c7,downstream);
std::string crNetobs = std::string(repositoryName) + "/" + IPM_REPOSITORY_LEVEL + "/cr_";
std::string agtFile = crNetobs + id + ".netobs";
toAdd = FALSE;
if(file_is_modified_since(agtFile.c_str(), tmpTmpLastAgtDataUpdate[atoi(id)]))
{
time(&tmpTmpLastAgtDataUpdate[atoi(id)]);
get_netobs_qos_values(cnb,ipnb,opnb,ibnb,obnb,md,ad,xd,id,repositoryName,IPM_REPOSITORY_LEVEL,lastreading,toAdd);
}
o=Oidx::from_string(OctetStr(from),TRUE);
o+=Oidx::from_string(OctetStr(to),TRUE);
o+=Oidx::from_string(OctetStr(protocol),TRUE);
o+=Oidx::from_string(OctetStr(application),TRUE);
o+=Oidx::from_string(OctetStr(direction),TRUE);
o+=Oidx::from_string(OctetStr(upstream),TRUE);
o+=Oidx::from_string(OctetStr(downstream),TRUE);
if(toAdd)
{
myRow = find_index(o);
if(myRow == NULL)
{
myRow = add_row(o);
}
set_row (myRow,
from,
to,
protocol,
application,
direction,
upstream,
downstream,
strtoul(cnb,0,10),
strtoul(ipnb,0,10),
strtoul(opnb,0,10),
strtoul(ibnb,0,10),
strtoul(obnb,0,10),
strtoul(md,0,10),
strtoul(ad,0,10),
strtoul(xd,0,10),
strtoul(id,0,10));
}
else
{
remove_row(o);
}
end_synch ();
}
....
....
....
best Regards
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.agentpp.org/pipermail/agentpp/attachments/20000912/a3497518/attachment.htm
More information about the AGENTPP
mailing list