CoolInterview.com - World's Largest Collection of Interview Questions
Start Your Own website Now
Sponsored Links

Interview Questions
Our Services

Get 9,000 Interview Questions & Answers in an eBook.


  • 9500+ Pages
  • 9000 Question & Answers
  • All Tech. Categories
  • 14 MB Content

    Get it now !!



    Send your Resume to 6000 Companies


  • INTERVIEW QUESTIONS MICROSOFT ARCHITECTURE DETAILS
    Question :
    What is the race around condition? How can it be overcome?


    Category Architecture Interview Questions
    Rating (0.4) By 1310 users
    Added on 7/27/2006
    Views 2597
    Rate it!
    Answers:

    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?



    Posted by: Divya    

    Contact Divya Contact Divya

    If you have the better answer, then send it to us. We will display your answer after the approval.
    Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification  Enter the above shown code:*
    Inform me about updated answers to this question

       
    Related Questions
    View Answer
    How do you improve the cache performance. ?

    View Answer
    What is cache coherency and how is it eliminated?

    View Answer
    What is write back and write through caches?

    View Answer
    Explain what is DMA?

    View Answer
    What is cache?

    View Answer
    What is pipelining?

    View Answer
    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?

    View Answer
    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?

    View Answer
    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?

    View Answer
    What is a managed code.
    Is 'Dim fs as filestreamobject' is a managed code?

    View Answer


    Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

    View ALL Architecture Interview Questions

    User Options
    Sponsored Links


    Copyright ©2003-2014 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions

    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Dedicated Servers | C Interview Questions & Answers

    Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes


    Cache = 1.53125 Seconds