In financial and trading applications thread safety is a very crucial aspect. An application which demonstrates thread safety is actually safe from application crash and sudden data loss. The thread safety feature even allows performance benefits for the applications as a whole. The concept of thread safety ensures that each functional aspect of an application is controlled by the multiple threads of the same process. The thread safety also ensures that multi tasking within the same application does not generate multiple processes which can consume more memory than other applications. In many cases it has been seen that if applications do not implement thread safety then the chances of application crash increases. When the system resources are shared, an application demonstrating thread safety will be much secured than non-thread safe applications. Thus for the benefit of the organization the trading and finance applications must implement thread safety while it is being developed.
class DataFeedCollection : BindingList<DataFeed>
{
private Control _control;
//The method is called when data is updated (for ex. data comes from TCP/IP)
void OnUpdateReceiced(...)
{
_control.Invoke(new MethodInvoker(delegate
{
//Raise notification in GUI thread
OnListChanged(new ListChangedEventArgs(...));
}));
}
}
DataGrid someGrid = ...;
DataFeedCollection DataFeed = ...;
someGrid.DataSource = DataFeed;
For example in the above case the thread safety feature ensures that while the grid starts receiving data from the INotifyPropertyChanged and IBindingList, then synchronization of the thread is ensured. Thus the thread safety feature in the above case prevents harmful conditions such as deadlock. Thus the thread safety feature ensured proper performance and efficacy while implementing data security via implementation of thread synchronization.
class DataFeedCollection : BindingList<Feed>
{
//The method is called when data is updated (for ex. data comes from TCP/IP)
void OnUpdateReceiced(...)
{
//Raise notification directly from non-GUI thread
//Dapfor .Net Grid will synchronize threads itself.
OnListChanged(new ListChangedEventArgs(...));
}
}
Dapfor.Net.Ui.Grid grid = ...;
DataFeedCollection Datafeed = ...;
grid.DataSource = Datafeed;
In the above example the data layer is kept separate from the other layers by the thread safety feature. Thus the thread safety feature ensures that the data remains secured and is not prone to any loss. Especially in cases of voluminous update the amount of data can be an issue in many cases. Due to lack of enough system resources the application might face issues with resource sharing feature and hence might face abrupt termination in many cases. The thread safety feature ensures that the application does not run on a single process, but a set of multiple threads in order to avoid deadlock for resource sharing. This ensures that if the update process is in the middle then the data is not prone to loss if deadlock scenario arises. Thus this feature is essential in financial applications.
class DataFeedCollection : BindingList<DataFeed>
{
private Control _control;
//The method is called when data is updated (for ex. data comes from TCP/IP)
void OnUpdateReceiced(...)
{
_control.Invoke(new MethodInvoker(delegate
{
//Raise notification in GUI thread
OnListChanged(new ListChangedEventArgs(...));
}));
}
}
DataGrid someGrid = ...;
DataFeedCollection DataFeed = ...;
someGrid.DataSource = DataFeed;
For example in the above case the thread safety feature ensures that while the grid starts receiving data from the INotifyPropertyChanged and IBindingList, then synchronization of the thread is ensured. Thus the thread safety feature in the above case prevents harmful conditions such as deadlock. Thus the thread safety feature ensured proper performance and efficacy while implementing data security via implementation of thread synchronization.
class DataFeedCollection : BindingList<Feed>
{
//The method is called when data is updated (for ex. data comes from TCP/IP)
void OnUpdateReceiced(...)
{
//Raise notification directly from non-GUI thread
//Dapfor .Net Grid will synchronize threads itself.
OnListChanged(new ListChangedEventArgs(...));
}
}
Dapfor.Net.Ui.Grid grid = ...;
DataFeedCollection Datafeed = ...;
grid.DataSource = Datafeed;
In the above example the data layer is kept separate from the other layers by the thread safety feature. Thus the thread safety feature ensures that the data remains secured and is not prone to any loss. Especially in cases of voluminous update the amount of data can be an issue in many cases. Due to lack of enough system resources the application might face issues with resource sharing feature and hence might face abrupt termination in many cases. The thread safety feature ensures that the application does not run on a single process, but a set of multiple threads in order to avoid deadlock for resource sharing. This ensures that if the update process is in the middle then the data is not prone to loss if deadlock scenario arises. Thus this feature is essential in financial applications.