Wednesday 15 February 2012

c# - Can Static Members that Accept Variables Become Corrupt? -


I'm having trouble creating this question, so I'll tell it some ways so that it does not end in steady ways Repeating the general discussion. This can be more of an architecture question.

If you have a stable member on the static class who accepts the variable passed, then there is a danger of data confrontation / corruption if the operation is running high and is running long? IE: The Data Access Class is accepting the object graph type for firmness in a database.

For example:

  Namespace MyApp.DAL.People {Public Stable Class Person {Public Static Void Insert (Inst. People, People P) {// ADO Try .net code, hold etc., execute db, call other personal method ... helper (p); } Private Static Zero Helper (Inst. People. Pisser P) {// Work ...}}}   

If user starts "A" a person. Insert (myNewPerson) completes the call operation that the user completes the complete process before using the "B" method to save the stable class and database to its "person object".

Is Operation Serial and Asynchronous Essentially Blocked for the Use of Static Class?

Is this just a problem if the application (a developer) was trying to use multiple threads in an application space?

Is everything going on until you spin clearly the other thread for an application?

As a side note, this is my first post - so thank everyone who took the time to post questions / answers - your time is appreciated!

If two different threads call person.entert same In time, both of them will be executed at the same time. As long as the method is not explicitly blocked. The data entered in thread a by

p parameter will not be accessible from . Let's say that two threads pass the context of completely different object instances.

Calls are completely secure, as long as the insert method does not access anything on the external circuit. For example, all methods will vary for local variables, two threads. This happens when the method (or calls to the methods) starts to reach data on external problems, when you start the problems.

No comments:

Post a Comment