Race conditions is a severe way crashing the server/ system at times. Generally this problem arises in priority less systems or the users who has eqal priority will be put to this problem. Race condition is a situation in which a resource D is to be serviced to a process A and the processB which holds the resoure C is to be given to the process A. So a cyclic chain occurs and no way the resources will be get shared and also the systems with equal prirority wont get the resoure so that the system wont come out of the blocked state due to race condition!
Race condition is a bug in your application, occurs when the result of your application depends on which one of two or more threads reaches a shared block of code first. In this case, the application output changes each time it is executed!
As an example; assume that we have a shared integer object called x, and we have two threads 1, and 2. Thread number 1 attempt to increment the x object by one, and during this increment process, its time slice has been finished. Thread 2 time slice just start and it attempt to increment the same x object too. Thread 2 incremented the x object successfully, and then its time slice finished. Thread 1 starts a new time slice and completing the increment process not knowing that the object x value is already changed. This is a race condition, and the output of such code is of course incorrect!
The above race condition problem can be solved by using an object like "InterLock", with its "Increment", and "Decrement" methods.
Race conditions can be avoided generally by considering each line of code you write, and asking yourself: What might happen if a thread finished before executing this line? or during executing this line? and another thread overtook it?
The number or character entered through keyboard gets converted to equivalent ASCII code & it get stored on RAM in the binary form. What is the exact procedure on hardware that converts the ASCII value to Binary?
The characters entered through keyboard gets converted to equivalent ASCII code & stored on RAM in the binary form. What is exact procedure to happens on hardware that converts the ASCII value to equivalent binary form?
In designing component package / framework using Interface programming, where is the best place to put the Interfaces to reduce dependencies? In a single assembly that is referenced by other assemblies. In the domain assembly near the class that inherits the interface? or In the client assembly where the interface is being used?