Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

can anyone explains threads and processes

Options
  • 11-03-2007 4:24pm
    #1
    Registered Users Posts: 1,073 ✭✭✭


    hi guys
    hope ye are well
    i have a end od year exam tomorrow but i cant seem toget my head around threads and processes
    can anyone try and exploain this to me in as straight forward a way as possible
    thanks
    ed

    woudl really appreciate help


Comments

  • Closed Accounts Posts: 7,230 ✭✭✭scojones


    A process is a running instance of a program. It has a PID (Process ID), which is essentially a unique number for the operating system to keep track of. The reason for this is you can have a program running multiple times. Think of having IE open several times, each instance will have a PID, as each instance is unique.

    Threads provide multiple "threads of execution" within the same program in a shared memory address space. Basically, IE can both be downloading a file for you and can also be loading a web page for you. Or think of it this way: In the middle of a page loading you click on Tools -> Internet Options. IE uses a thread to load the page for you, and a thread to bring up the Internet Options window. Threads make it look like the running process of IE is doing several things concurrently. They also help keep GUI's responsive to users clicking on the GUI when stuff is going on in the background.

    I wrote a program that does some file transfers. Transfering a file that is 1gig in size caused the GUI to freeze up until the file was transfered, so a user could not click on it. The solution was to have a thread for user input, and a thread for the file transfer.

    Does that make any sense?


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    You should blog that somewhere scojones, I'm sure it will help a lot of students out.


  • Closed Accounts Posts: 7,230 ✭✭✭scojones


    The software, Evil Phil?


Advertisement