c# - Unity "ContainerControlled" Singletons and multi-threaded method calling -


I am using Microsoft Unity for Dependency Injection (DI). My classes are basically static (calling in coding / conventions, not just in functionality) except that I want DI, so I use Unity and Constructors which automatically solves other Unity classes.

Since this is a singleton pattern, do multiple formulas execute the same code block at the same time?

i.e. Suppose I have an add method, which returns an int, and takes it as an input, two ants ...

Whether multiple-threads at the same time in a singleton object on this method Can you add? Or because this is the same example, are the threads waiting to block?

To keep it on the other side, is there any difference between the method of calling for a static method, a singleton vs. method?

(I know that any shared data used from within singleton instantiation methods should be secured to thread)

There is no distinction Thread security is important only when you have some shared state that you need security as a way of yours Described - Simple Combination Operation - A Surak To Receive All Relevant References In The Call Stack It does not matter, so that you can use it safely in a multi-threaded environment.

There is a difference between example method calls and a steady method call in both a functional and non functional areas. Static methods are considered negligently sharp compared to example methods, but they can not be effectively used in polymorphic software designs - (well, at least not in C #)


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -