Saturday, June 10, 2006

Java Thread : notify and notifyAll

Had this question : "notify results in a single thread acquiring a lock whereas notifyAll results in all the threads competing for the lock and one of them acquiring it so any way only one thread is able to acquire the lock, so why do we need notfyAll at all."
The answer lies in : Even though in the first case only one thread gets the lock, the problem occurs in that there may be no other threads to notify the other threads which called wait() earlier. So, if we call notifyAll, all the threads will be waken up and will be competing for the lock. So, to compete for the lock, first step is to get woken up by getting a notification from another thread that is going to release the lock.

Got the above content from this link

1 comment:

Anonymous said...

Web hosting is a server in regard to serving and maintaining files after anecdote or more web sites.
A web hosting mending is a type of Internet hosting overhaul that longing mitigate an singular, business, college, superintendence organization and more place their website on the To the max Large Web.
[url=http://www.jkahosting.com]Web hosting [/url] companies purvey play on a server for use via their clients as artistically as the internet accessibility required to get on the web.
Even more prominent than the computer lacuna is a unpolluted situation in the course of the files and a fast link to the Internet.
There are innumerable different types of trap hosts, put down panels, operating systems, and options.
In adding up there are included services such as website builders, search machine marketing, database deployment, and online stores.
So how do you grasp what to exploit and who to rent it from?
Since they are so tons options this can be confusing.
The earliest thingummy you want to decide is if you privation a Windows trap tummler or a linux spider's web host.
Much of the time it does not problem come what may if you be undergoing determined software to capitalize on such as a shopping convey or database relevance this wishes be important.
It is worst to find out cold from your software provider the requirements of the program.
Then you will necessity to decide on if you miss a domain baptize and the amount of latitude and bandwidth needed.
Diverse web hosting companies literally occasion away empire names to new customers so this may assist grip your business.
In addendum scads network hosts also give up a gigantic amount of duration and bandwidth in their hosting plans hoping you desire not truly call it.
So at once that you keep adamant on the operating system and how much you scarcity now fail us look at the options.
A most trendy selection is the speak of a unshackled website builder. This can be eminent if you get no or midget experience with html programming. If you receive some experience and use a database you make then have occasion for to choose how varied databases you require. Some hosts purposefulness occasion you unlimited databases and some direct blame per database. There are also innumerable other freebies accessible such as instinctive handwriting (software) base, shopping carts, templates, search apparatus optimization assistance, innumerable realm hosting and much more. Spam ban is also an powerful feature you should assume from your host.
Now that you be dressed start the options you are looking representing it is measure to look against a host.
Wow! There are so many. A sincere search in search the term network innkeeper last wishes as create thousands of results. So who do you choose?
A spider's web innkeeper should usually be present in lawsuit you have need of assistance. At the least they should drink a expropriate desk and faq square in case you secure questions. If practicable a phone multitude is also helpful. They should also take precautions a lecherous server so your website is instantly clear and not stupid to view. In over they should provide no or very little downtime. This is when your website is not clear at all. Finally your files should be in a secure environment. After all you do not lack someone accessing your files or infecting your website with malware.
To conclude they are tons web hosting options and hosts. It is prominent to do your homework to find the first one with a view your website.