<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>ERP BASIC</title><description>Don't Worry, We Have Solution</description><managingEditor>noreply@blogger.com (Admin)</managingEditor><pubDate>Thu, 29 Oct 2026 12:45:06 +0530</pubDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">406</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><link>http://erpbasic.blogspot.com/</link><language>en-us</language><itunes:explicit>no</itunes:explicit><itunes:subtitle>Don't Worry, We Have Solution</itunes:subtitle><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><item><title>ORA-12532: TNS:invalid argument</title><link>http://erpbasic.blogspot.com/2012/09/ora-12532-tnsinvalid-argument.html</link><author>noreply@blogger.com (Jyothish)</author><pubDate>Tue, 11 Sep 2012 14:54:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-4943537009987891677</guid><description>&lt;br /&gt;sqlplus system@orcl&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 11.1.0.6.0 - Production on Sun Aug 19 13:18:56 2007&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle. All rights reserved.&lt;br /&gt;&lt;br /&gt;Enter password:&lt;br /&gt;ERROR:&lt;br /&gt;ORA-12532: TNS:invalid argument&lt;br /&gt;&lt;br /&gt;In this case we can ping to remote host but not able to connect database which we have created on remote host.&lt;br /&gt;&lt;br /&gt;Cause : Listener port is closed.May be a firewall policy make the issue.&lt;br /&gt;&lt;br /&gt;Action : We need to open Listener port for communication .By default Listener port is 1521.</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">221</thr:total></item><item><title>Insert Array Output into Database</title><link>http://erpbasic.blogspot.com/2012/07/insert-array-output-into-database.html</link><category>Array</category><category>PHP</category><category>PHP Problem</category><author>noreply@blogger.com (Admin)</author><pubDate>Wed, 25 Jul 2012 22:58:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-1325410182322423043</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Hello Friends now a days i am working on php.A few days ago i got a task from my trainer&amp;nbsp;and task was to uploading a txt file in new folder and output should be in an array format&amp;nbsp;using loops and after that insert that output into database and&amp;nbsp;the content in the text file was 100 email id's.At that time i was new in php and&amp;nbsp;no idea how to start my task and how to use loops.For that i searched on net for many times&amp;nbsp;but i couldn't find the required data to complete task on single site.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;So,i had to serach many sites to collect or get idea how to complete my task.Now here in this post&amp;nbsp;i am going to share that program with you so that if you get similar task like this task you&amp;nbsp;can get help from this,i hope it will be helpful to you.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style="text-align: left;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: large;"&gt;&lt;b&gt;Here the program is:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;1) Using this code you can upload your file from one folder to another folder.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: red;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: red;"&gt;&amp;lt;?php&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;if (($_FILES&lt;span style="color: red;"&gt;["file"&lt;/span&gt;][&lt;span style="color: red;"&gt;"type"&lt;/span&gt;] ==&lt;span style="color: red;"&gt; 'text/plain'&lt;/span&gt;) &amp;amp;&amp;amp; ($_FILES&lt;span style="color: red;"&gt;["file"&lt;/span&gt;][&lt;span style="color: red;"&gt;"size"&lt;/span&gt;] &amp;lt; &lt;span style="color: red;"&gt;20000&lt;/span&gt;))&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; if ($_FILES["file"]["error"] &amp;gt; 0)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; echo "Return Code: " . $_FILES["file"]["error"] . "&amp;lt;br /&amp;gt;";&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; else&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; echo "Upload: " . $_FILES["file"]["name"] . "&amp;lt;br /&amp;gt;";&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; echo "Type: " . $_FILES["file"]["type"] . "&amp;lt;br /&amp;gt;";&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb&amp;lt;br /&amp;gt;";&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "&amp;lt;br /&amp;gt;";&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; if (file_exists("nit/" . $_FILES["file"]["name"]))&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; echo $_FILES["file"]["name"] . " already exists. "."&amp;lt;br/&amp;gt;"."&amp;lt;br/&amp;gt;";&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; else&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; move_uploaded_file($_FILES["file"]["tmp_name"],&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "nit/" . $_FILES["file"]["name"]);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; echo "Stored in: " . "nit/" . $_FILES["file"]["name"]."&amp;lt;br /&amp;gt;";&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; }&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; ?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;2) Use this code after 1st code as shown above, By using this code you will get your output in array format and after that output will be insert into database, see this code how its works,&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $file = fopen("file.txt", "r");&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt; if ($file) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt; &amp;nbsp; while (!feof($file))&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt; &amp;nbsp; $aa=fgets($file);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt; &amp;nbsp; $explode= explode(",",$aa);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt; &amp;nbsp; print_r(explode(',',$aa));&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt; &amp;nbsp; foreach ($explode as $id =&amp;gt;$email_id)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp;$sql="insert into aa (id,email_id) values ('$id','$email_id')";&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp;$result=mysql_query($sql);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt; fclose($file);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;Note:- In this above code we are using while loop as well as explode function after that we are using insert statement to insert output into database.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;I hope you will find it informative.&lt;/div&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">82</thr:total></item><item><title>Reclaiming Unused Space in Index.</title><link>http://erpbasic.blogspot.com/2012/06/reclaiming-unused-space-in-index.html</link><author>noreply@blogger.com (Jyothish)</author><pubDate>Mon, 11 Jun 2012 12:12:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-8157785682625849361</guid><description>We can see Reclaimable space in Schema by using below query.&lt;br /&gt;&lt;br /&gt;SELECT'Task Name : ' || f.task_name || CHR(10) ||'Start Run Time : ' || TO_CHAR(execution_start, 'dd-mon-yy hh24:mi') || chr (10) ||'Segment Name : ' || o.attr2 || CHR(10) ||'Segment Type : ' || o.type || CHR(10) ||'Partition Name : ' || o.attr3 || CHR(10) ||'Message : ' || f.message || CHR(10) ||'More Info : ' || f.more_info || CHR(10) ||&lt;br /&gt;'------------------------------------------------------' Advice FROM dba_advisor_findings f,dba_advisor_objects o,dba_advisor_executions e WHERE o.task_id = f.task_id AND o.object_id = f.object_id AND f.task_id = e.task_id AND e. execution_start &gt; sysdate - 1 AND e.advisor_name = 'Segment Advisor' ORDER BY f.task_name;&lt;br /&gt;&lt;br /&gt;                &lt;span style="font-weight:bold;"&gt;Solution&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             There are a couple of effective methods for freeing up unused space associated with an index:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;           •Rebuilding the index &lt;br /&gt;           •Shrinking the index &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          Before you perform either of these operations, first check &lt;br /&gt;USER_SEGMENTS to verify that the amount of space used corresponds with the Segment Advisor’s advice. In this example, the segment name is F_REGS_IDX1&lt;br /&gt;&lt;br /&gt;SQL&gt; select bytes from user_segments where segment_name = 'F_REGS_IDX1';&lt;br /&gt;BYTES----------&lt;br /&gt;166723584&lt;br /&gt;&lt;br /&gt;This example uses the&lt;br /&gt;ALTER INDEX...REBUILD&lt;br /&gt;&lt;br /&gt;statement to re-organize and compact the space usedby an index:&lt;br /&gt;&lt;br /&gt;SQL&gt; alter index f_regs_idx1 rebuild;&lt;br /&gt; Alternatively, use the&lt;br /&gt;ALTER INDEX...SHRINK SPACE statement to free up unused space in an index—for example:&lt;br /&gt;&lt;br /&gt;SQL&gt; alter index f_regs_idx1 shrink space;&lt;br /&gt;&lt;br /&gt;Now query &lt;br /&gt;&lt;br /&gt;USER_SEGMENTS&lt;br /&gt;&lt;br /&gt;again to verify that the space has been de-allocated. Here is the output forthis example:&lt;br /&gt;&lt;br /&gt;BYTES----------&lt;br /&gt;524288&lt;br /&gt;&lt;br /&gt;The space consumed by the index has considerably decreased.&lt;br /&gt;&lt;br /&gt;I prefer export and import is the another useful method to reclaim free space.</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">371</thr:total></item><item><title>" Bharat Bandh " Is it reality or just a show off.</title><link>http://erpbasic.blogspot.com/2012/05/bharat-bandh-is-it-realty-or-just-show.html</link><author>noreply@blogger.com (Admin)</author><pubDate>Thu, 31 May 2012 14:19:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-456812868139303100</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;"&gt;&lt;b&gt;Is the bandh&lt;/b&gt; is the only way to protest,&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;"&gt;what type of bandh is this where people are forced to stay home and shut down their shops. All anti social elements are having a great time.  A bandh should be something where people protest by themselves. Policitcan dont their work in Parliament and does not allow us to work too. What have they gained by calling this bandh we lost one day's pay.&lt;/span&gt; &lt;br /&gt;
&lt;span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8KSuMtmY9nhNcPApVXH_gFRUKX7KL5DM8qhPWmT-7NoRAsYMr3cnbcHqO0WddErxxNAQ9TTn59mADCpiQqF5CbuAKyM4jw2ACPXnXSetVSm943pqXX9maJjfZmPa1Js8mRD9oOgnCCSzf/s1600/Bharat_bandh20120531110111_l.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="372" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8KSuMtmY9nhNcPApVXH_gFRUKX7KL5DM8qhPWmT-7NoRAsYMr3cnbcHqO0WddErxxNAQ9TTn59mADCpiQqF5CbuAKyM4jw2ACPXnXSetVSm943pqXX9maJjfZmPa1Js8mRD9oOgnCCSzf/s640/Bharat_bandh20120531110111_l.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px;"&gt;&lt;b&gt;&amp;nbsp;Its just a show off&lt;/b&gt;. If really the cry needs to be heard, there is no point in destroying public properties or blocking roads. Think! cover all petrol pumps, don't allow anyone to fill petrol tanks(allow only people who are in emergency i.e. hospital , ambulance, traveling etc). Cover up govt. offices, don't allow anyone to go inside. When govt. takes a hit, then they think about it. Rt now , general public is getting a hit, how does it affect the govt?&lt;/span&gt; &lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8KSuMtmY9nhNcPApVXH_gFRUKX7KL5DM8qhPWmT-7NoRAsYMr3cnbcHqO0WddErxxNAQ9TTn59mADCpiQqF5CbuAKyM4jw2ACPXnXSetVSm943pqXX9maJjfZmPa1Js8mRD9oOgnCCSzf/s72-c/Bharat_bandh20120531110111_l.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">61</thr:total></item><item><title>What is thread pool? Why should we use thread pools?</title><link>http://erpbasic.blogspot.com/2012/03/what-is-thread-pool-why-should-we-use.html</link><category>Thread Related Question</category><author>noreply@blogger.com (Swati Goyal)</author><pubDate>Tue, 20 Mar 2012 15:40:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-9216622496011589206</guid><description>&lt;div style="text-align: justify; "&gt;&lt;span style="font-size: 100%; "&gt;&lt;b style="font-family: Georgia, serif; "&gt;Ans:&lt;/b&gt; &lt;span &gt;A thread pool is a collection of threads on which task can be scheduled. Instead of creating a new thread for each task, you can have one of the threads from the thread pool pulled out of the pool and assigned to the task. When the thread is finished with the task, it adds itself back to the pool and waits for another assignment. One common type of thread pool is the fixed thread pool. This type of pool always has a specified number of threads running; if a thread is somehow terminated while it is still in use, it is automatically replaced with a new thread. Below are key reasons to use a Thread Pool&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-weight: normal; "&gt;&lt;ul&gt;&lt;li style="text-align: justify;"&gt;&lt;span style="font-size: 100%; "&gt;Using thread pools minimizes the JVM overhead due to thread creation. Thread objects use a significant amount of memory, and in a large-scale application, allocating and de-allocating many thread objects creates a significant memory management overhead.&lt;/span&gt;&lt;/li&gt;&lt;li style="text-align: justify;"&gt;&lt;span style="font-size: 100%; text-align: left; "&gt;You have control over the maximum number of tasks that are being processed in parallel (= number of threads in the pool).&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-family: Georgia, serif; font-weight: normal; "&gt;Most of the executor implementations in java.util.concurrent use thread pools, which consist of worker threads. This kind of thread exists separately from the Runnable and Callable tasks it executes and is often used to execute multiple tasks.&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-weight: normal; "&gt;&lt;br /&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">41</thr:total></item><item><title>What is a thread leak? What does it mean in Java?</title><link>http://erpbasic.blogspot.com/2012/03/what-is-thread-leak-what-does-it-mean.html</link><category>Thread Related Question</category><author>noreply@blogger.com (Swati Goyal)</author><pubDate>Tue, 20 Mar 2012 15:35:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-8472660128196971982</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div style="font-style: normal; font-variant: normal; line-height: normal; text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;&lt;b style="font-family: Georgia, serif;"&gt;Ans:&lt;/b&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Thread leak is when a application does not release references to a thread object properly. Due to this some Threads do not get garbage collected and the number of unused threads grow with time. Thread leak can often cause serious issues on a Java application since over a period of time too many threads will be created but not released and may cause applications to respond slow or hang.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-style: normal; font-variant: normal; line-height: normal; text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-style: normal; font-variant: normal; line-height: normal;"&gt;&lt;b&gt;Q:How can I trace whether the application has a thread leak?&lt;/b&gt;&lt;/div&gt;&lt;div style="font-style: normal; font-variant: normal; line-height: normal; text-align: justify;"&gt;&lt;b style="font-family: Georgia, serif;"&gt;Ans:&lt;/b&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-weight: normal;"&gt;If an application has thread leak then with time it will have too many unused threads. Try to find out what type of threads is leaking out. This can be done using following ways:&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;ul style="font-style: normal; font-variant: normal; line-height: normal;"&gt;&lt;li&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; text-align: left;"&gt;Give unique and descriptive names to the threads created in application. - Add log entry in all thread at various entry and exit points in threads.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; text-align: left;"&gt;Change debugging config levels (debug, info, error etc) and analyze log messages.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; text-align: left;"&gt;When you find the class that is leaking out threads check how new threads are instantiated and how they're closed.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; text-align: left;"&gt;Make sure the thread is Guaranteed to close properly by doing following - Handling all Exceptions properly.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; text-align: left;"&gt;Make sure the thread is Guaranteed to close properly by doing following&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; text-align: left;"&gt;            -Handling all Exceptions properly.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; text-align: left;"&gt;            -releasing all resources (e.g. connections, files etc) before it closes.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">49</thr:total></item><item><title>How will you take thread dump in Java? How will you analyze Thread dump?</title><link>http://erpbasic.blogspot.com/2012/03/how-will-you-take-thread-dump-in-java.html</link><category>Thread Related Question</category><author>noreply@blogger.com (Swati Goyal)</author><pubDate>Tue, 20 Mar 2012 15:19:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-3402901645452014684</guid><description>&lt;div style="text-align: justify;"&gt;&lt;span &gt;&lt;b&gt;Ans:&lt;/b&gt; A Thread Dump is a complete list of active threads. A java thread dump is a way of finding out what each thread in the JVM is doing at a particular point of time. This is especially useful when your java application seems to have some performance issues. Thread dump will help you to find out which thread is causing this. There are several ways to take thread dumps from a JVM. It is highly recommended to take more than 1 thread dump and analyze the results based on it. Follow below steps to take thread dump of a java process&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt; •Step 1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt; On UNIX, Linux and Mac OSX Environment run below command: &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt; ps -el | grep java &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt; On Windows: &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt; Press Ctrl+Shift+Esc to open the task manager and find the PID of the java process &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt; •Step 2: &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt; Use jstack command to print the Java stack traces for a given Java process PID&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Georgia, serif; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Georgia, serif; "&gt; jstack [PID]&lt;/span&gt;&lt;/div&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "&gt;&lt;br /&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">65</thr:total></item><item><title>Why are wait(), notify() and notifyAll() methods defined in the object class?</title><link>http://erpbasic.blogspot.com/2012/03/why-are-wait-notify-and-notifyall.html</link><category>Thread Related Question</category><author>noreply@blogger.com (Swati Goyal)</author><pubDate>Tue, 20 Mar 2012 15:15:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-8528271392830531317</guid><description>&lt;div style="text-align: justify;"&gt;&lt;b&gt;Ans:&lt;/b&gt; The purpose of the wait(), notify() and notifyAll() methods is to temporarily pause and resume the execution of code in an object. Typically the host object is not in a state where it can proceed with a method call it has been given and the thread of execution must literally wait for the object to return to a ready state. A common example would be a limited pool or store of objects where you must wait for a storage slot to be released or an object to be returned to the pool before you can use it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;public synchronized Object getNextObject() {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;  // Waiting loop&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;  while (! objectAvailable()) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;    try {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;      wait();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;    catch (InterruptedException e) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;      // Handle exception&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;  }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;  // No longer waiting, get the return object&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;  Object returnObject;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;  // Assign the returnObject from store&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;  // Notify state change for other waiters&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;  notify();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;  return returnObject;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;    &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;The act of waiting is associated with the Object class because any subclass may need to wait for a ready state to occur (Java is fundamentally a multi-threaded language). The waiting process acts on a single thread of execution, but the wait mechanism expects that multiple threads may be waiting for the same object. The wait() and notify() methods are hosted by the Object class so that the Java Virtual Machine can manage the “wait set” of threads through the objects they are waiting for.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "&gt;&lt;br /&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">15</thr:total></item><item><title>What is Starvation? What is a Livelock?</title><link>http://erpbasic.blogspot.com/2012/03/what-is-starvation-what-is-livelock.html</link><category>Thread Related Question</category><author>noreply@blogger.com (Swati Goyal)</author><pubDate>Fri, 16 Mar 2012 15:20:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-8000820758657218474</guid><description>&lt;div style="font-style: normal; line-height: normal; "&gt;&lt;span &gt;&lt;b&gt;Starvation&lt;/b&gt; and&lt;b&gt; livelock &lt;/b&gt;are much less common a problem than deadlock, but are still problems that every designer of concurrent software is likely to encounter.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-style: normal; line-height: normal; "&gt;&lt;b&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="font-style: normal; line-height: normal; "&gt;&lt;b&gt;&lt;span &gt;LiveLock&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="font-style: normal; line-height: normal; font-weight: normal; "&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-style: normal; line-height: normal; text-align: justify; font-weight: normal; "&gt;&lt;span &gt;&lt;span&gt;Livelock&lt;/span&gt; occurs when all threads are blocked, or are otherwise unable to proceed due to unavailability of required resources, and the non-existence of any unblocked thread to make those resources available. In terms of Java API, thread livelock can occur in following conditions:&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-style: normal; font-variant: normal; line-height: normal; font-weight: normal; "&gt;&lt;ul&gt;&lt;li style="text-align: justify; "&gt;&lt;span style="font-family: arial; "&gt;When all the threads in a program execute Object.wait(0) on an object with zero parameter. The program is live-locked and cannot proceed until one or more threads call Object.notify() or Object.notifyAll() on the relevant objects. Because all the threads are blocked, neither call can be made.&lt;/span&gt;&lt;/li&gt;&lt;li style="text-align: justify; "&gt;&lt;span style="font-family: arial; text-align: left; "&gt;When all the threads in a program are stuck in infinite loops.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; line-height: normal; "&gt;&lt;span&gt;&lt;b&gt;Starvation&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; line-height: normal; font-weight: normal; "&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-size: 100%; font-family: Georgia, serif; text-align: justify; "&gt;&lt;span style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "&gt;&lt;span&gt;Starvation &lt;/span&gt;describes a situation where a thread is unable to gain regular access to shared resources and is unable to make progress. This happens when shared resources are made unavailable for long periods by "greedy" threads. For example, suppose an object provides a synchronized method that often takes a long time to return. If one thread invokes this method frequently, other threads that also need frequent synchronized access to the same object will often be blocked. Starvation occurs when one thread cannot access the CPU because one or more other threads are monopolizing the CPU. In Java, thread starvation can be caused by &lt;/span&gt;&lt;span&gt;setting thread priorities inappropriately. A lower-priority thread can be starved by higher-priority threads if the higher-priority threads do not yield control of the CPU from time to time.&lt;/span&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">24</thr:total></item><item><title>What is the difference between sleep(), suspend() and wait()?</title><link>http://erpbasic.blogspot.com/2012/03/what-is-difference-between-sleep.html</link><category>Thread Related Question</category><author>noreply@blogger.com (Swati Goyal)</author><pubDate>Fri, 16 Mar 2012 14:38:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-4315538130124372372</guid><description>&lt;div style="text-align: justify;"&gt;&lt;b style="font-family: Georgia, serif; "&gt;Ans:&lt;/b&gt;&lt;span &gt;Thread.sleep() sends the current thread into the "Not Runnable" state for some amount of time. The thread keeps the monitors it has aquired -- i.e. if the thread is currently in a synchronized block or method no other thread can enter this block or method. If another thread calls t.interrupt() it will wake up the sleeping thread. Note that sleep is a static method, which means that it always affects the current thread (the one that is executing the sleep method). A common mistake is to call t.sleep() where t is a different thread; even then, it is the current thread that will sleep, not the t thread. t.suspend() is deprecated. Using it is possible to halt a thread other than the current thread. A suspended thread keeps all its monitors and since this state is not interruptable it is deadlock prone. object.wait() sends the current thread into the "Not Runnable" state, like sleep(), but with a twist. Wait is called on a object, not a thread; we call this object the "lock object." Before lock.wait() is called, the current thread must synchronize on the lock object; wait() then releases this lock, and adds the thread to the "wait list" associated with the lock. Later, another thread can synchronize on the same lock object and call lock.notify(). This wakes up the original, waiting thread. Basically, wait()/notify() is like sleep()/interrupt(), only the active thread does not need a direct pointer to the sleeping thread, but only to the shared lock object.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt;&lt;b&gt;Q:What are native operating system threads?&lt;/b&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span &gt;&lt;b&gt;Ans:&lt;/b&gt; &lt;/span&gt;&lt;span &gt;Native operating system threads are those provided by the computer operating system that plays host to a Java application, be it Windows, Mac or GNU/Linux. Operating system threads enable computers to run many programs simultaneously on the same central processing unit (CPU) without clashing over the use of system resources or spending lots of time running one program at the expense of another. Operating system thread management is usually optimised to specific microprocessor architecture and features so that it operates much faster than Java green thread processing. &lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "&gt;&lt;br /&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>What is ThreadLocal class? How can it be used?</title><link>http://erpbasic.blogspot.com/2012/03/what-is-threadlocal-class-how-can-it-be.html</link><category>Thread Related Question</category><author>noreply@blogger.com (Swati Goyal)</author><pubDate>Fri, 16 Mar 2012 14:29:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-8582314332422035141</guid><description>&lt;div&gt;&lt;span style="font-size: 100%; "&gt;&lt;b style="font-family: Georgia, serif; "&gt;Ans:&lt;/b&gt;&lt;span&gt;Below are some key points about ThreadLocal variables&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: 100%; "&gt;A thread-local variable effectively provides a separate copy of its value for each thread that uses it.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 100%; "&gt;ThreadLocal instances are typically private static fields in classes that wish to associate state with a thread&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 100%; "&gt;In case when multiple threads access a ThreadLocal instance, separate copy of Threadlocal variable is maintained for each thread.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 100%; "&gt;Common use is seen in DAO pattern where the DAO class can be singleton but the Database connection can be maintained separately for each thread. (Per Thread Singleton) &lt;/span&gt;&lt;span style="font-size: 100%; font-family: arial; "&gt;ThreadLocal variable are difficult to understand and I have found below reference links very useful in getting better understanding on them&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style="font-weight: normal; "&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;b&gt;Q:When InvalidMonitorStateException is thrown? Why?&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;span&gt;Ans: This exception is thrown when you try to call wait()/notify()/notifyAll() any of these methods for an Object from a point in your program where u are NOT having a lock on that object.(i.e. u r not executing any synchronized block/method of that object and still trying to call wait()/notify()/notifyAll()) wait(), notify() and notifyAll() all throw IllegalMonitorStateException. since This exception is a subclass of RuntimeException so we r not bound to catch it (although u may if u want to). and being a RuntimeException this exception is not mentioned in the signature of wait(), notify(), notifyAll() methods.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-weight: normal; "&gt;&lt;br /&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">7</thr:total></item><item><title>Folder Option Not Visible In Tools Menu</title><link>http://erpbasic.blogspot.com/2012/03/folder-option-not-visible-in-tools-menu.html</link><category>Technology</category><author>noreply@blogger.com (Admin)</author><pubDate>Wed, 14 Mar 2012 21:54:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-1957123624027801962</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Want to change your windows folder options such as Show hidden files or Hide extensions for know file types.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;But my folder options is not visible. How to make folder options visible under tools menu.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5CVC89ZWRoTfc0smv06y1MeenE9K4L0wMNJnUDcmd2-0RGZsEcGZEG_QRg1ftP4dIKxAH6Q3lJ1cxQBrtwV5x3UCT73Go5YBbMMbi9NkETjMW5HViCr_3v4Gb8dqMiKHoji65hZ5U3vgZ/s1600/Windows-7-Folder-Options_thumb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5CVC89ZWRoTfc0smv06y1MeenE9K4L0wMNJnUDcmd2-0RGZsEcGZEG_QRg1ftP4dIKxAH6Q3lJ1cxQBrtwV5x3UCT73Go5YBbMMbi9NkETjMW5HViCr_3v4Gb8dqMiKHoji65hZ5U3vgZ/s1600/Windows-7-Folder-Options_thumb.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: magenta; font-family: Arial, Helvetica, sans-serif;"&gt;Here is the solution:&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;Step 1 : Goto Start Menu and Select Run otpion.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;Step 2 : Type gpedit.msc in run dialog box. Group Policy dialog box will be displayed.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;Step 3 : In Group Policy dialog box in the left pane select&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;user configuration-&amp;gt;administrative templates-&amp;gt;windows components-&amp;gt;windows explorer&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;Step 4 : In left pane double click on "Removes the folder options menu item from the tools menu".&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;Step 5 : Change its setting to disabled.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;Step 6 : Close the Group Policy Dialog box.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;Step 7 : Check tools menu in windows explorer.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: lime; font-family: Arial, Helvetica, sans-serif;"&gt;enjoy.............&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5CVC89ZWRoTfc0smv06y1MeenE9K4L0wMNJnUDcmd2-0RGZsEcGZEG_QRg1ftP4dIKxAH6Q3lJ1cxQBrtwV5x3UCT73Go5YBbMMbi9NkETjMW5HViCr_3v4Gb8dqMiKHoji65hZ5U3vgZ/s72-c/Windows-7-Folder-Options_thumb.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>How do Java threads make the environment asynchrnous?</title><link>http://erpbasic.blogspot.com/2012/03/how-do-java-threads-make-environment.html</link><category>Thread</category><category>Thread Related Question</category><author>noreply@blogger.com (Admin)</author><pubDate>Wed, 14 Mar 2012 19:34:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-7095145370119082890</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Ans:&lt;/b&gt; The thread mechanism in Java begins with the main entry point thread the runtime environment creates to start a Java program. When you use that initial thread create secondary threads, each one runs independently of the other. The Java virtual machine manages the execution of the threads so they behave as if they all run at the same time, in fact each thread briefly takes turns at execution.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;In its simplest form there may be no communication or synchronization between multiple threads in a Java program and they each run to completion independently of each other. In this respect Java threads are fundamentally asynchronous, there is no master clock that governs when threads will run and when they synchronize variables to “catch-up” with each other.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;It is often necessary and more useful if threads do check ready states before progressing, synchronize read and write access to shared variables and call-back to each other when their work is done. This is where the synchronized keyword and the various sleep(), wait() and notify() methods are used to more closely schedule the interaction between asynchronous threads.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>Power On Your Computer With Mouse</title><link>http://erpbasic.blogspot.com/2012/03/power-on-your-computer-with-mouse.html</link><category>Technology</category><author>noreply@blogger.com (Admin)</author><pubDate>Tue, 13 Mar 2012 22:34:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-5716818998430124155</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Want to power on your computer?&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Press Power Button on cabinet.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Is there any other way?&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Yah...&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Double Click with your mouse.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;But for that you need to make some settings.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Here goes the settings.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: blue;"&gt;Step 1 Restart your computer.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: blue;"&gt;Step 2 Press DEL button (F2 in some motherboards) to goto the BIOS settings.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: blue;"&gt;Step 3 Select Integrated Peripherals from main menu.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: blue;"&gt;Step 4 If PS/2 mouse power on disabled, activate it by press page up/ page down key it will became Double-Click.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: blue;"&gt;Step 5 Press Esc key to exit.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: blue;"&gt;Step 6 Press F10 to save and exit Power off your PC.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: blue;"&gt;Step 7 Now double-click the left mouse button,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;.. &lt;span style="color: magenta;"&gt;Your PC will turn on&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;This trick may not work with some motherboards&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total></item><item><title>What are the advantages or usage of threads?</title><link>http://erpbasic.blogspot.com/2012/03/what-are-advantages-or-usage-of-threads.html</link><category>Thread Related Question</category><author>noreply@blogger.com (Swati Goyal)</author><pubDate>Fri, 9 Mar 2012 14:24:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-5877148246589159273</guid><description>&lt;div&gt;&lt;span style="font-family: Georgia, serif; "&gt;&lt;b&gt;Ans)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt; &lt;/span&gt;&lt;span &gt;&lt;b&gt;Threads support concurrent operations. For example,&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span &gt;--  Multiple requests by a client on a server can be handled as an individual client thread.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: arial; "&gt;-- Long computations or high-latency disk and network operations can be handled in the background without disturbing foreground computations or screen updates. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt;&lt;b&gt;Threads often result in simpler programs.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span &gt;-- &lt;/span&gt;&lt;span &gt;In sequential programming, updating multiple displays normally requires a big while-loop that performs small parts of each display update. Unfortunately, this loop basically simulates an operating system scheduler. In Java, each view can be assigned a thread to provide continuous updates.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span &gt;-- &lt;/span&gt;&lt;span &gt;Programs that need to respond to user-initiated events can set up service routines to handle the events without having to insert code in the main routine to look for these events.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span &gt;&lt;b&gt;Threads provide a high degree of control.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span &gt;-- &lt;/span&gt;&lt;span &gt;Imagine launching a complex computation that occasionally takes longer than is satisfactory. A "watchdog" thread can be activated that will "kill" the computation if it becomes costly, perhaps in favor of an alternate, approximate solution. Note that sequential programs must muddy the computation with termination code, whereas, a Java program can use thread control to non-intrusively supervise any operation. &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt;&lt;b&gt;Threaded applications exploit parallelism.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span &gt;-- &lt;/span&gt;&lt;span &gt;A computer with multiple CPUs can literally execute multiple threads on different functional units without having to simulating multi-tasking ("time sharing").&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span &gt;-- &lt;/span&gt;&lt;span &gt;On some computers, one CPU handles the display while another handles computations or database accesses, thus, providing extremely fast user interface response times.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "&gt;&lt;br /&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>Difference between Multithreading and Multiprocessing</title><link>http://erpbasic.blogspot.com/2012/03/difference-between-multithreading-and.html</link><category>Thread Related Question</category><author>noreply@blogger.com (Swati Goyal)</author><pubDate>Fri, 9 Mar 2012 13:55:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-5530751233696132313</guid><description>&lt;div style="text-align: justify; "&gt;&lt;span &gt;&lt;b&gt;Multi-threading&lt;/b&gt; refers to an application with multiple threads running within a process, while multi-processing refers to an application organised across multiple OS-level processes.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify; "&gt;&lt;span &gt;&lt;b&gt;A thread&lt;/b&gt; is a stream of instructions within a process. Each thread has its own instruction pointer, set of registers and stack memory. The virtual address space is process specific, or common to all threads within a process. So, data on the heap can be readily accessed by all threads, for good or ill.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify; "&gt;&lt;span &gt;&lt;b&gt;Multi-threading &lt;/b&gt;is a more "light weight" form of concurrency: there is less context per thread than per process. As a result thread lifetime, context switching and synchronisation costs are lower. The shared address space (noted above) means data sharing requires no extra work.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify; "&gt;&lt;span &gt;&lt;b&gt;Multi-processing&lt;/b&gt; has the opposite benefits. Since processes are insulated from each other by the OS, an error in one process cannot bring down another process. Contrast this with multi-threading, in which an error in one thread can bring down all the threads in the process. Further, individual processes may run as different users and have different permissions.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; "&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-tab-span" style="font-family: white-space: pre; "&gt; &lt;/span&gt;&lt;b&gt;&lt;span&gt;Difference between multitasking multiprogramming and multithreading?&lt;/span&gt;&lt;/b&gt;&lt;span&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Multiprogramming is a rudimentary form of parallel processing in which several programs are run at the same time on a uniprocessor.Since there is only one processor, there can be no true simultaneous execution of different programs. Instead, the operating system executes part of one program, then part of another, and so on. To the user it appears that all programs are executing at the same time.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Multitasking, in an operating system, is allowing a user to perform more than one computer task (such as the operation of an application program) at a time. The operating system is able to keep track of where you are in these tasks and go from one to the other without losing information&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Multithreading is the ability of a program or an operating system process to manage its use by more than one user at a time and to even manage multiple requests by the same user without having to have multiple copies of the program running in the computer &lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">43</thr:total></item><item><title>What is difference between thread and process?</title><link>http://erpbasic.blogspot.com/2012/03/what-is-difference-between-thread-and.html</link><category>Thread</category><category>Thread Related Question</category><author>noreply@blogger.com (Admin)</author><pubDate>Thu, 8 Mar 2012 20:03:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-4984973871598273366</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
&amp;nbsp;&lt;b&gt;Ans)&lt;/b&gt; &lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Differences between threads and processes are:-&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;1. Threads share the address space of the process that &amp;nbsp;created it; processes have their own address.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;2. Threads have direct access to the data segment of its process; processes have their own copy of the data segment of the parent process.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;3. Threads can directly communicate with other threads of its process; processes must use interprocess communication to communicate with sibling processes.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;4. Threads have almost no overhead; processes have considerable overhead.&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;5. New threads are easily created; new processes require duplication of the parent process.&lt;/span&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;6. Threads can exercise considerable control over threads of the same process; processes can only exercise control over child processes.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;7. Changes to the main thread (cancellation, priority change, etc.) may affect the behavior of the other threads of the process; changes to the parent process do not affect child processes.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">10</thr:total></item><item><title>Questions Related to Thread</title><link>http://erpbasic.blogspot.com/2012/03/questions-related-to-thread.html</link><category>Thread</category><category>Thread Related Question</category><author>noreply@blogger.com (Admin)</author><pubDate>Wed, 7 Mar 2012 19:35:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-1627165503405868875</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;Q:What’s the difference between Thread and Runnable types?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Ans:&lt;/b&gt; Java Thread controls the main path of execution in an application. When you invoke the Java Virtual Machine with the java command, it creates an implicit thread in which to execute the main method. The Thread class provides a mechanism for the first thread to start-up other threads to run in parallel with it.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;The Runnable interface defines a type of class that can be run by a thread. The only method it requires is run, which makes the interface very easy to to fulfil by extending existing classes. A runnable class may have custom constructors and any number of other methods for configuration and manipulation.&lt;/span&gt;&lt;/div&gt;&lt;b style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b style="font-family: Arial, Helvetica, sans-serif;"&gt;Q: If all methods are synchronized, is a class thread safe?&lt;/b&gt;&lt;br /&gt;
&lt;b style="font-family: Arial, Helvetica, sans-serif; text-align: justify;"&gt;Ans:&lt;/b&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; text-align: justify;"&gt; Even if all the methods of a class are synchronized, it may still be vulnerable to thread safety problems if it exposes non-final fields or its methods return mutable object references that could be manipulated by multiple threads. Non-final fields should be declared private and encapsulated with synchronization. Rather than return references to internal object fields, create an independent copy that has no relation to the original, known as a deep copy.&lt;/span&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;A deep copy of an object duplicates the content and state of the original object and all its constituent fields in such a way that none of its properties refer to instances in the original at any level.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;These measures will help prevent uncontrolled access to the internal state of objects, but you must also ensure synchronization techniques are applied in a robust, consistent manner that will not cause deadlock or race conditions. It is generally better to use synchronized blocks than synchronized methods for performance reasons. Limit the extent of synchronized blocks and ensure they all use the same object monitor.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Q: What's the difference between a thread's start() and run() methods?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style="font-family: Arial, Helvetica, sans-serif; text-align: justify;"&gt;Ans:&lt;/b&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; text-align: justify;"&gt; The separate start() and run() methods in the Thread class provide two ways to create threaded programs. The start() method starts the execution of the new thread and calls the run() method. The start() method returns immediately and the new thread normally continues until the run()method returns.&lt;/span&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;The Thread class' run() method calls the run() method of the Runnable type class passed to its constructor. Subclasses of Thread should override the run() method with their own code to execute in the second thread.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Depending on the nature of your threaded program, calling the Thread run() method directly can give the same output as calling via the start() method. Howevever, the code will only be executed in a new thread if the start() method is used.&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Q: What is a Runnable object and a Runnable argument?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Ans: &lt;/b&gt;A Runnable object is one that implements the Runnable interface, which is the type used to execute new threads. The Runnable interface only has one method, run(), which must be implemented by a Runnable class.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;In Java an argument is a primitive value or object reference that is passed to a constructor or method, defined in the method signature. A Runnable argument would be a constructor or method argument that is declared to be a Runnable type. The constructor of the Thread class is the most obvious example.&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;public Thread(Runnable target);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;This constructor requires a Runnable type argument to be passed when a Thread is instantiated.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Q: What is a green thread?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Ans:&lt;/b&gt; A green thread refers to a mode of operation for the Java Virtual Machine (JVM) in which all code is executed in a single operating system thread. If a Java program has any concurrent threads, the JVM manages multi-threading behaviour internally rather than use additional operating system threads.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;There is a significant processing overhead for the JVM to keep track of thread states and swap between them, so green thread mode has been deprecated and removed from more recent Java implementations. Current JVM implementations make more efficient use of native operating system threads. These days there is no case where the green thread approach is useful except on systems where this is the only concurrency scheme that is available for Java, on old operating systems and hardware platforms.&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Q:What are the daemon threads?&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Ans:&lt;/b&gt;&amp;nbsp;Daemon thread are service provider threads run in the background,these not used to run the application code generally.When all user threads(non-daemon threads) complete their execution the jvm exit the application whatever may be the state of the daemon threads. Jvm does not wait for the daemon threads to complete their execution if all user threads have completed their execution.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;To create Daemon thread set the daemon value of Thread using setDaemon(boolean value) method. By default all the threads created by user are user thread. To check whether a thread is a Daemon thread or a user thread use isDaemon() method.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Example of the Daemon thread is the Garbage Collector run by jvm to reclaim the unused memory by the application. The Garbage collector code runs in a Daemon thread which terminates as all the user threads are done with their execution.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Q:What happens if a start method is not invoked and the run method is directly invoked?&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Ans:&lt;/b&gt; If a thread has been instantiated but not started its is said to be in new state. Unless until a start() method is invoked on the instance of the thread, it will not said to be alive. If you do not call a start() method on the newly created thread instance thread is not considered to be alive. If the start() method is not invoked and the run() method is directly called on the Thread instance, the code inside the run() method will not run in a separate new thread but it will start running in the existing thread.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total></item><item><title>ThreadGroup Class - Access Restriction Methods</title><link>http://erpbasic.blogspot.com/2012/03/threadgroup-class-access-restriction.html</link><category>Thread</category><author>noreply@blogger.com (Swati Goyal)</author><pubDate>Wed, 7 Mar 2012 14:56:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-1195414404631175629</guid><description>&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;span &gt;The ThreadGroup class itself does not impose any access restrictions, such as allowing threads from one group to inspect or modify threads in a different group. Rather the Thread and ThreadGroup classes cooperate with security managers (subclasses of the SecurityManager  class), which can impose access restrictions based on thread group membership.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span &gt;The Thread and ThreadGroup class both have a method, checkAccess, which calls the current security manager's checkAccess method. The security manager decides whether to allow the access based on the group membership of the threads involved. If access is not allowed, the checkAccess method throws a SecurityException. Otherwise, checkAccess simply returns.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span &gt;The following is a list of ThreadGroup methods that call ThreadGroup's checkAccess before performing the action of the method. These are what are known as regulated accesses, that is, accesses that must be approved by the security manager before they can be completed.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;ul&gt;&lt;li&gt;&lt;span &gt;ThreadGroup(ThreadGroup parent, String name)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-align: left; "&gt;&lt;span &gt;setDaemon(boolean isDaemon)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-align: left; "&gt;&lt;span &gt;setMaxPriority(int maxPriority)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-align: left; "&gt;&lt;span &gt;stop&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-align: left; "&gt;&lt;span &gt;suspend&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-align: left; "&gt;&lt;span &gt;resume&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-align: left; "&gt;&lt;span &gt;destroy&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family: Georgia, serif; text-align: left; "&gt;This is a list of the methods in the Thread class that call checkAccess before proceeding:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span &gt;constructors that specify a thread group&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span &gt;stop&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span &gt;suspend&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span &gt;resume&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span &gt;setPriority(int priority)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span &gt;setName(String name)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span &gt;setDaemon(boolean isDaemon)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; line-height: normal; "&gt;&lt;b&gt;Related Posts:- &lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; line-height: normal; "&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/java-threadgroup-class.html"&gt;Java - ThreadGroup Class&lt;/a&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; line-height: normal; "&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-collection-ma.html"&gt;ThreadGroup Class - Collection Management Methods&lt;/a&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; line-height: normal; "&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-methods-that-operate.html"&gt;ThreadGroup Class - Methods that Operate on the Group &lt;/a&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; line-height: normal; "&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-methods-that-operate_06.html"&gt;ThreadGroup Class - Methods that Operate on all Threads within a Group &lt;/a&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>Some Unique Guinness World Records</title><link>http://erpbasic.blogspot.com/2012/03/some-unique-guinness-world-records.html</link><author>noreply@blogger.com (Admin)</author><pubDate>Wed, 7 Mar 2012 13:56:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-8972302371199814517</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYWLN2A_c125Mk31B0HMWD93vTaYkzAUxCzeE5ItB1PjpBLMG2uUSiiJlJz9AJMax-alrkWDQQVa322DBobpMI0zd_KJT0kGtp-xclJUfGOlziZo1kHo_ww16ueGX4uxr24WqHktRCV_tc/s1600/guiness_book_of_records_02.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="306" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYWLN2A_c125Mk31B0HMWD93vTaYkzAUxCzeE5ItB1PjpBLMG2uUSiiJlJz9AJMax-alrkWDQQVa322DBobpMI0zd_KJT0kGtp-xclJUfGOlziZo1kHo_ww16ueGX4uxr24WqHktRCV_tc/s400/guiness_book_of_records_02.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="background-color: white; border-bottom-style: none; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-style: none; border-left-width: 0px; border-right-style: none; border-right-width: 0px; border-top-style: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; vertical-align: baseline;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;1,253 Smurfs gathered in the high street in the town of Castleblayney in County Monaghan, Ireland on July 18, 2008. (Guinness World Records)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkc8lNlPEGUIcxH_XRW8AjA-SikHfIXRmX4Eoyh37eFIPwV7UoslysPk4f8jJPrdMjY9HXCIhwOk2Peu1V8tat43kT65ZQs4JbY4IbgxoVEdSesNwq2aorMrN_018sl3P1FrNfX0yHIAyT/s1600/guiness_book_of_records_15.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="281" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkc8lNlPEGUIcxH_XRW8AjA-SikHfIXRmX4Eoyh37eFIPwV7UoslysPk4f8jJPrdMjY9HXCIhwOk2Peu1V8tat43kT65ZQs4JbY4IbgxoVEdSesNwq2aorMrN_018sl3P1FrNfX0yHIAyT/s400/guiness_book_of_records_15.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; text-align: justify;"&gt;35,310 Lego Star Wars Clone Troopers in the UK.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPDPNwsYH3LY9Qp3Ev7X5xQ5mZlPUV0GF7M8pnIhEXGpgN33TdlRyvWZq5LNqA_uj18JbpLBKGwjHGCNdttN3cFy1caP3LJTQhAlVwhxoCXUYRMJ0HDe8-T1whc2mXKRDqxMMJPPTUBuR3/s1600/guiness_book_of_records_21.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPDPNwsYH3LY9Qp3Ev7X5xQ5mZlPUV0GF7M8pnIhEXGpgN33TdlRyvWZq5LNqA_uj18JbpLBKGwjHGCNdttN3cFy1caP3LJTQhAlVwhxoCXUYRMJ0HDe8-T1whc2mXKRDqxMMJPPTUBuR3/s400/guiness_book_of_records_21.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;The longest skis are 534 m long and were worn by 1,043 skiers in an event organized by Danske Bank on Drottninggatan in Örebro, Sweden, on 13 September 2008.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbbSts6-PxxSc4g-lPV0ozqUHVLRhUnimMG-ZETFJ9ezTVLgUF6d6S9DF5fl9TTr_SGAMWLPiV-yce7wr3GXVMqPBSFLfSLva0uNFSe8_Gux_sJ409m8bK8X87TuAvOnvVgBiy50RcbTHX/s1600/guiness_book_of_records_2_18.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbbSts6-PxxSc4g-lPV0ozqUHVLRhUnimMG-ZETFJ9ezTVLgUF6d6S9DF5fl9TTr_SGAMWLPiV-yce7wr3GXVMqPBSFLfSLva0uNFSe8_Gux_sJ409m8bK8X87TuAvOnvVgBiy50RcbTHX/s400/guiness_book_of_records_2_18.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;World's biggest pickup truck - 2002&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir6LPGeyvwUchW26ixX9_ZubVMzx3eSsT9EC8-lNv-BRkQKya5Q4Cp4AhJUsIj2LZvI5VxGdoZKzneDqnftQc0gNzwUjAo-tPEguSe9EfOcT2F8vsl6uCecaAlYKQafCKYRNX19m0DqiRp/s1600/guiness_book_of_records_2_19.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir6LPGeyvwUchW26ixX9_ZubVMzx3eSsT9EC8-lNv-BRkQKya5Q4Cp4AhJUsIj2LZvI5VxGdoZKzneDqnftQc0gNzwUjAo-tPEguSe9EfOcT2F8vsl6uCecaAlYKQafCKYRNX19m0DqiRp/s400/guiness_book_of_records_2_19.jpg" width="289" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEhHOThCpDItPyOdFAi6c6mXJzxdC0hbt8J6nbBpUzM-ZhCDXKV1j3JqvxdTYStli7UVNhjSnymeyI4amSBAbiyfdzJAmp14fKXr6SeQAXaK7Tzj2-AgvvoT2_nH65o0jm2YO6NFSsN-bj/s1600/guiness_book_of_records_2_06.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEhHOThCpDItPyOdFAi6c6mXJzxdC0hbt8J6nbBpUzM-ZhCDXKV1j3JqvxdTYStli7UVNhjSnymeyI4amSBAbiyfdzJAmp14fKXr6SeQAXaK7Tzj2-AgvvoT2_nH65o0jm2YO6NFSsN-bj/s400/guiness_book_of_records_2_06.jpg" width="270" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Surrey resident Sarwan Singh achieved a feat, which every Sikh is going to be proud of. He set a new Guinness Book of World Record by having the longest beard.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOebUkEH4RcfDdl270kxcC1F2Q59Iae2gA4QZcN9ljBVsl9BzGoRvfGT_7kgE4_H3MQ2J5yEcNhpXbIJsN-hFsZIKJzgCrWA4FNCHJLWYHFB0rmdrNXNbklUmMyLCxBFx_TjOEiGZyt8b4/s1600/guiness_book_of_records_04.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOebUkEH4RcfDdl270kxcC1F2Q59Iae2gA4QZcN9ljBVsl9BzGoRvfGT_7kgE4_H3MQ2J5yEcNhpXbIJsN-hFsZIKJzgCrWA4FNCHJLWYHFB0rmdrNXNbklUmMyLCxBFx_TjOEiGZyt8b4/s400/guiness_book_of_records_04.jpg" width="273" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif; text-align: justify;"&gt;The largest pocket knife was designed by Telmo Cadavez and hand made by Virgilio, Raul and Manuel Pires of Portugal.&amp;nbsp;The knife is 3.9m long when open and weighs 122kg.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUCNYSJfBeA5sJ9O8lFRzoEqFVA6lkyKp4CKHLzrQ0ei2xKwK3w7aOfXzJADSEQn86d31anwC_zNAuUpIksdhXHVYh90m_pi-QElHpiVCZ2vvFdGSst0cOn2fNLUNH_u4U67-Wmxajuamh/s1600/guiness_book_of_records_10.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUCNYSJfBeA5sJ9O8lFRzoEqFVA6lkyKp4CKHLzrQ0ei2xKwK3w7aOfXzJADSEQn86d31anwC_zNAuUpIksdhXHVYh90m_pi-QElHpiVCZ2vvFdGSst0cOn2fNLUNH_u4U67-Wmxajuamh/s400/guiness_book_of_records_10.jpg" width="286" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDgOiiMK935cb9h_9ImA_iVZZFfLKoKf6nqWTPiFLchECrOX2LXoUUShHXWevI-n4Db-nn3wq4Jhj1cH17RD3GFq6QZti60-ONpQCHAddIkBM2EjocYSTj-W2e_xpApCnIKdp5NNkM6MSV/s1600/guiness_book_of_records_2_12.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="312" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDgOiiMK935cb9h_9ImA_iVZZFfLKoKf6nqWTPiFLchECrOX2LXoUUShHXWevI-n4Db-nn3wq4Jhj1cH17RD3GFq6QZti60-ONpQCHAddIkBM2EjocYSTj-W2e_xpApCnIKdp5NNkM6MSV/s400/guiness_book_of_records_2_12.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;The largest commercially available hamburger is 74.75 kg (164.8 lbs) and is available for US$399 (£271.55) on the menu at Mallie's Sports Grill &amp;amp; Bar in Southgate, Michigan, USA, as of 29 August 2008.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinRffCpSkoj1iEQCQwSbmTEooJkxgjqy5daxwzHetuNmlAPHsFY1_8SytgJs-ufVZKaq1rXBrNl4lHJZVeibVn-1S1XttmuPZ0mCmc4Hrmd9RfymjL1Cxa6Te1bs3NcKSa3xSTSMyUUJic/s1600/guiness_book_of_records_07.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="252" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinRffCpSkoj1iEQCQwSbmTEooJkxgjqy5daxwzHetuNmlAPHsFY1_8SytgJs-ufVZKaq1rXBrNl4lHJZVeibVn-1S1XttmuPZ0mCmc4Hrmd9RfymjL1Cxa6Te1bs3NcKSa3xSTSMyUUJic/s400/guiness_book_of_records_07.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif; text-align: justify;"&gt;In Germany, Anita Schwarz set a new record for carrying the most steins of lager over 40m.&amp;nbsp;She staggered across the finishing line holding 19 glasses.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPM25oKBUEOUmUc7fPxJqWM2j0BX5OVgPWgmIdqXNpO_mxWg_LiHyOrfhPkX6-sgmdDFpxqPG1jrS0iRpND2VDDm2ILnXj_frHW9AySmRYe5UTVyPSvaz1uBoqj3OEyLBaxqSfflPZit_q/s1600/guiness_book_of_records_13.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="278" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPM25oKBUEOUmUc7fPxJqWM2j0BX5OVgPWgmIdqXNpO_mxWg_LiHyOrfhPkX6-sgmdDFpxqPG1jrS0iRpND2VDDm2ILnXj_frHW9AySmRYe5UTVyPSvaz1uBoqj3OEyLBaxqSfflPZit_q/s400/guiness_book_of_records_13.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Coke &amp;amp; Mentos Guiness world record With 1,911 explosions in Riga, Latvia&lt;/span&gt;.&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZmVQqEJlF6ZeH_vVWPXoCQFrTbUhvz22wlxUdWy-J4SxUU74EGZKIQi_BrAPKy_RpIhrzLSQ-dI_6nkcmlnefSX9a8O1UHRAxIEEcnR8AGh8f0NmC9jhXqXTykIw44xRo-Ds7sMCpHmTN/s1600/guiness_book_of_records_2_25.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="265" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZmVQqEJlF6ZeH_vVWPXoCQFrTbUhvz22wlxUdWy-J4SxUU74EGZKIQi_BrAPKy_RpIhrzLSQ-dI_6nkcmlnefSX9a8O1UHRAxIEEcnR8AGh8f0NmC9jhXqXTykIw44xRo-Ds7sMCpHmTN/s400/guiness_book_of_records_2_25.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY9_AVcp_SqIlMCOZ5WwcbMImDy-NIqOC0lQwJcsgU8L7UDu9Wj7U44oRHt1_WXFP_Mf0cTXvxJ8iPDVGrZa1peaPowDVpZn-KFQu4FiQ03tU0-tBof_1jDOoiL7P0ROgj3rVNDSWA8OZw/s1600/guiness_book_of_records_12.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY9_AVcp_SqIlMCOZ5WwcbMImDy-NIqOC0lQwJcsgU8L7UDu9Wj7U44oRHt1_WXFP_Mf0cTXvxJ8iPDVGrZa1peaPowDVpZn-KFQu4FiQ03tU0-tBof_1jDOoiL7P0ROgj3rVNDSWA8OZw/s400/guiness_book_of_records_12.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbF_t_I0C2IFy7y0bhj4S3RGqk3pUtFhrifDf8zA2wkJcE4CaJDg4fNIB9qrrSXyYP5ZreGv2zhQCQ743Sv6fDZ2pvrPHCUueRdS0iY8-xqU7sMuSVvwCj_1E38v0BnY1kafTFbnU60dDa/s1600/guiness_book_of_records_19.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="348" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbF_t_I0C2IFy7y0bhj4S3RGqk3pUtFhrifDf8zA2wkJcE4CaJDg4fNIB9qrrSXyYP5ZreGv2zhQCQ743Sv6fDZ2pvrPHCUueRdS0iY8-xqU7sMuSVvwCj_1E38v0BnY1kafTFbnU60dDa/s400/guiness_book_of_records_19.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYWLN2A_c125Mk31B0HMWD93vTaYkzAUxCzeE5ItB1PjpBLMG2uUSiiJlJz9AJMax-alrkWDQQVa322DBobpMI0zd_KJT0kGtp-xclJUfGOlziZo1kHo_ww16ueGX4uxr24WqHktRCV_tc/s72-c/guiness_book_of_records_02.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>ThreadGroup Class- Methods that Operate on all Threads within a Group</title><link>http://erpbasic.blogspot.com/2012/03/threadgroup-class-methods-that-operate_06.html</link><category>Thread</category><author>noreply@blogger.com (Swati Goyal)</author><pubDate>Tue, 6 Mar 2012 15:56:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-5147939045039243419</guid><description>&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: arial; "&gt;The ThreadGroup class has three methods that allow you to modify the current state of all the threads within that group:&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: Georgia, serif; white-space: pre; "&gt;resume&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="white-space: pre; font-family: Georgia, serif; "&gt;stop&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="white-space: pre; font-family: Georgia, serif; "&gt;suspend&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="white-space: pre; "&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: arial; "&gt;These methods apply the appropriate state change to every thread in the thread group and its subgroups.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: arial; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: arial; "&gt;&lt;b&gt;Related Posts:- &lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/java-threadgroup-class.html"&gt;Java - ThreadGroup Class&lt;/a&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-collection-ma.html"&gt;ThreadGroup Class - Collection Management Methods &lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-methods-that-operate.html"&gt;ThreadGroup Class - Methods that Operate on the Group&lt;/a&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-access-restriction.html"&gt;ThreadGroup Class - Access Restriction Methods&lt;/a&gt; &lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "&gt; &lt;/span&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>ThreadGroup Class - Methods that Operate on the Group</title><link>http://erpbasic.blogspot.com/2012/03/threadgroup-class-methods-that-operate.html</link><category>Thread</category><author>noreply@blogger.com (Swati Goyal)</author><pubDate>Tue, 6 Mar 2012 15:54:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-3757604860845126760</guid><description>&lt;div dir="ltr" style="text-align: left; " trbidi="on"&gt;&lt;div dir="ltr" trbidi="on" style="text-align: justify;"&gt;&lt;span&gt;The ThreadGroup class supports several attributes that are set and retrieved from the group as a whole. These attributes include the maximum priority that any thread within the group can have, whether the group is a "daemon" group, the name of the group, and the parent of the group.&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on" style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on" style="text-align: justify;"&gt;&lt;span&gt;The methods that get and set ThreadGroup attributes operate at the group level. They inspect or change the attribute on the ThreadGroup object, but do not affect any of the threads within the group. The following is a list of ThreadGroup methods that operate at the group level:&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;ul&gt;&lt;li&gt;&lt;span&gt;&lt;b&gt;getMaxPriority and setMaxPriority&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;b&gt;getDaemon and setDaemon&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;b&gt;getName&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;b&gt;getParent and parentOf&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;b&gt;toString&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on" style="text-align: justify;"&gt;&lt;span&gt;For example, when you use setMaxPriority to change a group's maximum priority, you are only changing the attribute on the group object; you are not changing the priority of any of the threads within the group. Consider the following program that creates a group and a thread within that group:&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on" style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;class MaxPriorityTest {&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;    public static void main(String[] args) {&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;        ThreadGroup groupNORM = new ThreadGroup(&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;                                "A group with normal priority");&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;        Thread priorityMAX = new Thread(groupNORM, &lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;                                "A thread with maximum priority");&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;    // set Thread's priority to max (10)&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;        priorityMAX.setPriority(Thread.MAX_PRIORITY);&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;    // set ThreadGroup's max priority to normal (5)&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;        groupNORM.setMaxPriority(Thread.NORM_PRIORITY);&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;        System.out.println("Group's maximum priority = " +&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;                groupNORM.getMaxPriority());&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;        System.out.println("Thread's priority = " +&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;                priorityMAX.getPriority());&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on" style="text-align: justify;"&gt;&lt;span&gt;When the ThreadGroup groupNORM is created, it inherits its maximum priority attribute from its parent thread group. In this case, the parent group priority is the maximum (MAX_PRIORITY) allowed by the Java runtime system. Next the program sets the priority of the priorityMAX thread to the maximum allowed by the Java runtime system. Then the program lowers the group's maximum to the normal priority (NORM_PRIORITY). The setMaxPriority method does not affect the priority of the priorityMAX thread, so that at this point, the priorityMAX thread has a priority of 10, which is greater than the maximum priority of its group, groupNORM. This is the output from the program:&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;&lt;b&gt;Group's maximum priority = 5&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on"&gt;&lt;span&gt;&lt;b&gt;Thread's priority = 10&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on" style="font-family: Georgia, serif; "&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on" style="text-align: justify;"&gt;&lt;span&gt;As you can see a thread can have a higher priority than the maximum allowed by its group as long as the thread's priority is set before the group's maximum priority is lowered. A thread group's maximum priority is used to limit a thread's priority when the thread is first created within a group or when you use setPriority to change the thread's priority. Note that setMaxPriority does change the maximum priority of all of its descendant-threadgroups.&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on" style="text-align: justify;"&gt;&lt;span style="font-family: arial; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on" style="text-align: justify;"&gt;&lt;span style="font-family: arial; "&gt;Similarly, a group's daemon status applies only to the group. Changing a group's daemon status does not affect the daemon status of any of the threads in the group. Furthermore, a group's daemon status does not in any way imply the daemon status of its threads--you can put any thread within a daemon thread group. The daemon status of a thread group simply indicates that the group will be destroyed when all of its threads have been terminated.&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on" style="text-align: justify;"&gt;&lt;span style="font-family: arial; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr" trbidi="on" style="text-align: justify;"&gt;&lt;span style="font-family: arial; "&gt;&lt;b&gt;Related Posts:- &lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; "&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/java-threadgroup-class.html"&gt;Java - ThreadGroup Class&lt;/a&gt; &lt;/div&gt;&lt;div style="font-family: Georgia, serif; "&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-collection-ma.html"&gt;ThreadGroup Class - Collection Management Methods&lt;/a&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; "&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-methods-that-operate_06.html"&gt;ThreadGroup Class - Method that Operate on all Threads within a Group &lt;/a&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; "&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-access-restriction.html"&gt;ThreadGroup Class - Access Restriction Methods&lt;/a&gt; &lt;/div&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total></item><item><title>ThreadGroup Class - Collection Management Methods</title><link>http://erpbasic.blogspot.com/2012/03/threadgroup-class-collection-ma.html</link><category>Thread</category><author>noreply@blogger.com (Swati Goyal)</author><pubDate>Tue, 6 Mar 2012 15:02:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-408754583310179225</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;The ThreadGroup provides a set of methods that manage the threads and subgroups within the group and allow other objects to query the ThreadGroup for information about its contents. For example, you can call ThreadGroup's activeCount method to find out the number of active threads currently in the group. The activeCount method is often used with the enumerate method to get an array filled with references to all the active threads in a ThreadGroup. For example, the listCurrentThreads method in the following example fills an array with all of the active threads in the current thread group and prints their names:&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;class EnumerateTest {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;    void listCurrentThreads() {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;        ThreadGroup currentGroup = Thread.currentThread().getThreadGroup();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;        int numThreads;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;        Thread[] listOfThreads;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;        numThreads = currentGroup.activeCount();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;        listOfThreads = new Thread[numThreads];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;        currentGroup.enumerate(listOfThreads);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;        for (int i = 0; i &amp;lt; numThreads; i++) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;            System.out.println("Thread #" + i + " = " + listOfThreads[i].getName());&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; text-align: justify;"&gt;Other collection management methods provided by the ThreadGroup class include activeGroupCount and list.&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;Related Posts:-&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/java-threadgroup-class.html"&gt;Java-ThreadGroup Class &lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-methods-that-operate.html"&gt;ThreadGroup Class - Methods that Operate on the Group&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-methods-that-operate_06.html"&gt;ThreadGroup Class - Methods that Operate on all Threads within a Group&lt;/a&gt; &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-access-restriction.html"&gt;ThreadGroup Class - Access Restriction Methods &lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>Java - ThreadGroup Class</title><link>http://erpbasic.blogspot.com/2012/03/java-threadgroup-class.html</link><category>Thread</category><author>noreply@blogger.com (Swati Goyal)</author><pubDate>Tue, 6 Mar 2012 14:31:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-3565155411851805410</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-family: arial; text-align: justify;"&gt;The ThreadGroup  class manages groups of threads for Java applications. A ThreadGroup can contain any number of threads. The threads in a group are generally related in some way, such as who created them, what function they perform, or when they should be started and stopped.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-family: arial; font-size: 100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: arial;"&gt;ThreadGroups can contain not only threads but also other ThreadGroups. The top-most thread group in a Java application is the thread group named main. You can create threads and thread groups in the main group. You can also create threads and thread groups in subgroups of main. The result is a root-like hierarchy of threads and thread groups:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; text-align: justify;"&gt;&lt;span style="font-family: arial; font-size: 100%; text-align: left;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5719305192367773890" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibWFRiLYNHu9zImPPKak5OCjb-S2brtOLd2LXROdoRwUSyeFmA5xN2wgfTAMa6lXeVHTYVZSMoBK8fhdwnTQrHPQY3bS-i3FRzu8yxm8y-Vwv_R92SnIwEQuOvPC2Cjj0dB2USVGMJWsJm/s1600/groups.trans.gif" style="display: block; font-family: arial; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center;" /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;The ThreadGroup class has methods that can be categorized as follows:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-collection-ma.html"&gt;Collection Management Methods&lt;/a&gt;--Methods that manage the collection of threads and subgroups contained in the thread group.&lt;/span&gt;&lt;/li&gt;&lt;li style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-methods-that-operate.html"&gt;Methods That Operate on the Group&lt;/a&gt;--These methods set or get attributes of the ThreadGroup object.&lt;/span&gt;&lt;/li&gt;&lt;li style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-methods-that-operate_06.html"&gt;Methods That Operate on All Threads within a Group&lt;/a&gt;--This is a set of methods that perform some operation, such as start or resume, on all the threads and subgroups within the ThreadGroup.&lt;/span&gt;&lt;/li&gt;&lt;li style="text-align: justify;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://erpbasic.blogspot.in/2012/03/threadgroup-class-access-restriction.html"&gt;Access Restriction Methods&lt;/a&gt;--ThreadGroup and Thread allow the security manager to restrict access to threads based on group membership.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibWFRiLYNHu9zImPPKak5OCjb-S2brtOLd2LXROdoRwUSyeFmA5xN2wgfTAMa6lXeVHTYVZSMoBK8fhdwnTQrHPQY3bS-i3FRzu8yxm8y-Vwv_R92SnIwEQuOvPC2Cjj0dB2USVGMJWsJm/s72-c/groups.trans.gif" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>Java - Thread Group</title><link>http://erpbasic.blogspot.com/2012/03/java-thread-group.html</link><category>Thread</category><author>noreply@blogger.com (Swati Goyal)</author><pubDate>Tue, 6 Mar 2012 14:23:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8112177544657508617.post-4601061337208729046</guid><description>&lt;div style="font-weight: normal; text-align: justify; "&gt;&lt;span style="font-size: 100%; "&gt;&lt;span&gt;Every Java thread is a member of a thread group. Thread groups provide a mechanism for collecting multiple threads into a single object and manipulating those threads all at once, rather than individually. For example, you can start or suspend all the threads within a group with a single method call. Java thread groups are implemented by the ThreadGroup  class in the java.lang package.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-weight: normal; text-align: justify; "&gt;&lt;span style="font-size: 100%; "&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-weight: normal; text-align: justify; "&gt;&lt;span&gt;The runtime system puts a thread into a thread group during thread construction. When you create a thread, you can either allow the runtime system to put the new thread in some reasonable default group or you can explicitly set the new thread's group. The thread is a permanent member of whatever thread group it joins upon its creation--you cannot move a thread to a new group after the thread has been created.&lt;/span&gt;&lt;/div&gt;&lt;div style="font-weight: normal; text-align: justify; "&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="font-family: Georgia, serif; font-weight: normal; white-space: pre; "&gt; &lt;/span&gt;&lt;b&gt;&lt;span&gt;The Default Thread Group&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Georgia, serif; "&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;span&gt;If you create a new Thread without specifying its group in the constructor, the runtime system automatically places the new thread in the same group as the thread that created it (known as the current thread group and the current thread, respectively). So, if you leave the thread group unspecified when you create your thread, what group contains your thread?&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;span&gt;When a Java application first starts up, the Java runtime system creates a ThreadGroup named main. Unless specified otherwise, all new threads that you create become members of the main thread group.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;span&gt;Many Java programmers ignore thread groups altogether and allow the runtime system to handle all of the details regarding thread groups. However, if your program creates a lot of threads that should be manipulated as a group, or if you are implementing a custom security manager, you will likely want more control over thread groups.&lt;/span&gt;&lt;span style="font-family: Georgia, serif; "&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify; "&gt;&lt;span style="font-size: 100%; text-align: left; "&gt;        &lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;span style="font-size: 100%; text-align: left; "&gt;&lt;b&gt;&lt;span&gt;Creating a Thread Explicitly in a Group&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-weight: normal; font-family: Georgia, serif; "&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;span&gt;As mentioned previously, a thread is a permanent member of whatever thread group it joins when its created--you cannot move a thread to a new group after the thread has been created. Thus, if you wish to put your new thread in a thread group other than the default, you must specify the thread group explicitly when you create the thread. The Thread class has three constructors that let you set a new thread's group:&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;span&gt;public Thread(ThreadGroup group, Runnable target)&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;span&gt;public Thread(ThreadGroup group, String name)&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;span&gt;public Thread(ThreadGroup group, Runnable target, String name)&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;span&gt;Each of these constructors creates a new thread, initializes it based on the Runnable and String parameters, and makes the new thread a member of the specified group. For example, the following code sample creates a thread group (myThreadGroup) and then creates a thread (myThread) in that group.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;b&gt;ThreadGroup myThreadGroup = new ThreadGroup("My Group of Threads");&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;b&gt;Thread myThread = new Thread(myThreadGroup, "a thread for my group");&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;span&gt;The ThreadGroup passed into a Thread constructor does not necessarily have to be a group that you create--it can be a group created by the Java runtime system, or a group created by the application in which your applet is running.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;font-weight: normal; "&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="font-family: Georgia, serif; font-weight: normal; white-space: pre; "&gt; &lt;/span&gt;&lt;b&gt;&lt;span&gt;Getting a Thread's Group&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="font-weight: normal; "&gt;&lt;span&gt;To find out what group a thread is in, you can call its getThreadGroup method:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;b&gt;theGroup = myThread.getThreadGroup();&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-weight: normal; font-family: Georgia, serif; "&gt;&lt;br /&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item></channel></rss>