ApplicationThreadPool synchronization

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
sudhapc
Hero Member
Hero Member
Posts: 23
Joined: 16 Oct 2018, 12:47

ApplicationThreadPool synchronization

Post by sudhapc »

Hi Team,

i have a requirement where i have to raise attributechangeevent (custom event inherting basemodelchangeevent)for any changes in the attributes.
i have implemented the code using threadpool.queue api but in uaexpert am able to see same data of that event is being raised twice.
when i debug am getting proper info.
How do i synchronize the threadpool?

Code: Select all

		foreach (var keyValuePairOfPreRequisiteData in m_DictionaryOfPreRequisiteForProjectData)
           	 {
			projectmodel.AttributeChangeEventModel.Affected =
                    keyValuePairOfPreRequisiteData .key.Nodeid;
                    
               		 projectmodel.AttributeChangeEventModel.AffectedType =
                    id;
                    
               		 projectmodel.AttributeChangeEventModel.Changes =
                    attributeChangeStructureTypeCollection.ToArray();
                    
                	projectmodel.AttributeChangeEventModel.Message = message;
                
			NodeManager.Server.ThreadPool.Queue(
                   	 projectmodel.AttributeChangeEventModel,
                    	projectmodel.projectEventHandler.EventHandler);
                  }
changes include data about displayname and datatype

Post Reply