Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What I learned at Uni today

Name: Anonymous 2009-12-03 10:43

Hackers
Access computer system or network without authorization
Breaks the law; can go to prison
Crackers
Break into systems to steal or destroy data
U.S. Department of Justice calls both hackers
Ethical hacker
Performs most of the same activities but with owner’s permission

Name: Anonymous 2009-12-07 12:09

Race conditions are another problem that can occur in a multithreaded environment. This happens when the relative timing in execution of multiple threads can affect the outcome of each the thread’s execution. For example, if two threads both access and modify the same variable to perform a few calculations, the result is non deterministic based on the relative execution of the statements in each thread. Here is some code to elaborate on this example:
Thread_1(){
    X =  X * 100;
    Print(X);   }
Thread_2(){
    X++;
    Print(X);   }
Lets say X starts out at 0. If Thread_1 was running slow and it timed out after the first statement (X = 0 * 100) and then the second statement would have to wait until Thread_2 times out. Thread two runs fast enough to finish its operation before timing out, resulting in printing out (1). Thread_1 gets the processor again and starts back up where it left of, right about to print X. When Thread_1 prints X it also gets the same result (1) because X was modified before it was able to print out its result. What ends up happening is the user who put in request for thread one got the answer 0 times 100 is equal to 1 which is obviously wrong. This must be fixed for the system to maintain its deterministic nature.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List