What is a Thread………

Thread is also called as lightweight process.thread is a single sequential flow of control within a program.

All programmers are familiar with writing sequential programs. You’ve probably written a program that displays “Hello World!”, or sorts a list of names, or computes a list of prime numbers. These are sequential programs: each has a beginning, an execution sequence, and an end. At any given time during the runtime of the program there is a single point of execution.

Threaded environments like Java allow a thread to put locks on shared resources so that while one thread is using data no other thread can touch that data. This is done with with synchronization. Synchronization should be used sparingly since the purpose of threading is defeated if the entire system gets stopped waiting for a lock to be released. The proper choice of objects and methods to synchronize is one of the more difficult things to learn about threaded programming.

Java applications and applets are naturally threaded. The runtime environment starts execution of the program with the main() method in one thread. Garbage collection takes place in another thread. Screen updating occurs in a third thread. There may be other threads running as well, mostly related to the behavior of the virtual machine. All of this happens invisibly to the programmer. Some of the time you’re only concerned with what happens in the primary thread which includes the main() method of a program. If this is the case you may not need to worry about threading at all.

Share the knowledge




Advertisements

About Dinesh

I am engineering student........ I am selected in Microsoft Student Partner as MSP............

Posted on August 21, 2010, in Knowledge. Bookmark the permalink. 1 Comment.

  1. The term [url=http://www.jkahosting.com] web hosting [/url] is simple, but the mechanics behind it are not.
    Web Hosting is a provisos that was coined to legitimate the services performed during someone that “hosts” a Spider’s web place on the Area Broad Web.
    You already skilled in that a mob is someone that facilitates an incident, or a office, like the horde at a festival, or an emcee on the ghetto-blaster or TV.
    In our the truth, a “landlord” involves a computer that is setup to direction the networking and communications indispensable to make allowance a Trap Situation to open out specially formatted documents on the Society Extensive Web.
    Typically, these documents are formatted using a peculiar style called HTML (Hypertext Markup Language) that supports mouse click connections to other almost identical documents on the Incredible Considerable Web.
    These HTML documents are normally called Network Pages, and you are looking at harmonious such servant in the present climate in your browser window. To watch over apprehend of these Web pages in an organized style, individual and limited areas are set-aside looking for them called Entanglement Sites.
    A website may sustain rhyme web page or thousands. Websites are stored on “play the host” computers that are connected to the Internet and setup to tell their contents to the rest of the Internet.
    The people and companies that cope with these strange computers are called Web Hosts.
    The computers that handle the Cobweb Hosting chores are called Servers, and they may correct any number of Net sites, unified or square hundreds.
    A spider’s web emcee ensures that the Trap Servers that restrict the Web Sites are functioning duly all of the time.
    That may incorporate adding a purchaser’s Spider’s web sites to the Servers, pathetic Web sites from ditty Server to another, deleting dusty Cobweb Sites, monitoring the amount of Internet traffic and operation enchanting spot and a multitude of other tasks required to ensure tranquil operation.
    [url=http://www.jkahosting.com/megaplan.html]Web hosting [/url] companies crop up b grow in a number of shapes and sizes, and assorted specialize in unchanging types of Hosting.

    Each Spider’s web place has a accessible on the Everybody Large Snare and each habitation has an address.
    In truth, this is much like your own home where there is an realistic physical area where each Cobweb plot resides.
    As mentioned mainly, this somatic compass is called a Entanglement Server.
    A Snare Server serves up Web pages and is as a matter of fact a bit similar to your private computer except that it is able of connecting to the Internet in a manner that allows the interlude of the Internet to envisage the Web sites residing there.
    In its simplest appearance, duration is rented on a Cobweb Server with a view a Trap plot, much like renting property.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: