C# (aka C Sharp)
analysis on the operating system/programming language
C# (aka C Sharp) is the programming language selected for this discussion.
Threading is very common with this language and “the program begins by creating an object of type Alpha (oAlpha) and a thread (oThread) that references the Beta method of the Alpha class. The thread is then started. The IsAlive property of the thread allows the program to wait until the thread is initialized (Threading, N.d.)”. One thing to take not with this language is one does not have to “stop or free the thread”. It claimed to be accomplish mechanically via “.NET framework”. (Threading, N.d.).
According to the article from Stackoverflow, it is not up to “C# itself, but rather the runtime - CLR. .NET can be considered to support two modes: User or Hybrid” (Stackoverflow, N.d.). “Direct kernel mode threading is not allowed, because managed code does not have privileges to run in the kernel mode. It can only call Windows API, which in turn switch into the kernel mode (Stackoverflow, N.d.)”.
There are many advantages and disadvantages with threading and this would be true for all programming languages and operating systems.
The advantages for threading is the allowance of multiple people to access the same program at the same time; the use for less servers; “Simplified coding of remote procedure calls; Improved performance and concurrency” (Bea, N.d.).
Threading is very beneficial but there are more difficulties getting to this point. The disadvantages in regards to threading is the matter with “writing the code; debugging; testing; and difficulty of porting existing code” (Bea, N.d.). Porting the existing code means the programmer must “remove static variables, replace any function calls that are not thread-safe, replace any other code that is not thread-safe. Because the completed port must be tested and re-tested, the work required to port a multithreaded and/or multicontexted application is substantial (Bea, N.d.)”.