Conferences of University of Defence in Brno, ICMT 2015

Font Size: 
Benefits of the Use of Asynchronous Methods in a WCF Service and its Client, Synchronizing Resource Access between these Methods
Igor Kostal

Last modified: 2015-04-22

Abstract


This paper shortly describes creating asynchronous methods by delegates, the locking techniques and locking a shared resource by an instance method using the Monitor.Enter and Monitor.Exit member methods of the Monitor class. The paper demonstrates the use of asynchronous methods and locking shared resources in the distributed .NET application which consists of the Windows Communication Foundation (WCF) service with threaded method and the threaded Windows Forms client. The sample distributed .NET application was built in the C# language and in the Microsoft Visual Studio 2013 development environment. This distributed .NET application computes the definite integrals values of the function f(x) = x/(1 + x^2) by the trapezoidal rule in a threaded serial method of the WCF service and in a threaded serial method of the Windows Forms client. This client keeps the responsiveness of its user interface during executing an asynchronous call by asynchronous methods, locks and unlocks shared resources by its methods using Monitor.Enter and Monitor.Exit member methods of the Monitor class. In military mechatronic systems it is often necessary to determine dynamic parameters of mechanical parts, i.e. solids of these systems, such as a moment of inertia or a rotational kinetic energy of these solids. If such a solid is the solid of revolution created by the revolution of the area under the curve of a function f(x) within an interval <a, b> around the x axis to calculate the moment of inertia and rotational kinetic energy of such the solid it is needed to calculate the value of the definite integral of this function on this interval. Our distributed .NET application is able to calculate the value of the definite integral of the function f(x) = x/(1 + x^2). After our application extension about methods for computing values of the definite integrals of other functions this application can be a part of the control software of the mechatronic system of some military assembly. This control software can monitor the dynamic parameters of particular solids of this system by this application then.

Keywords


distributed application architecture; WCF Service; asynchronous instance method; secondary thread; synchronization; locking; numerical integration; trapezoidal rule

An account with this site is required in order to view papers. Click here to create an account.