Session--process--Threads
b/S Web site, each user's access is a session, the session contains the CPU for the user in memory to open up space storage session information,
such as session, process, session has a process, the same process can have more than one thread.
session, process, number of threads:
1. When the user requests a page in the same browser (session), if only one page is opened,
Session (1), process (1), Thread (1).
2. When a user requests a page in the same browser (session), multiple windows are opened
Session (1), process (1), Thread (N).
non-thread safe:
In most cases, it refers to static variables \ Global variables, etc., if it is a static read-only variable, thread safety
Thread Safety:
Creating a critical section with lock ensures that only one thread accesses the critical section when multithreading enters the critical section, and other threads block the queue.
Reference article:
Single-threaded and multithreaded with life examples
lock Statement (C # Reference ):Https://msdn.microsoft.com/zh-cn/library/c5kehkcz (vs.80). aspx
General solution for high concurrency scenarios: http://www.cnblogs.com/lanxiaoke/p/6657935.html#3657667
C # thread safety and lock
C # sessions, processes, threads, thread safety