<br />
<b>Warning</b>:  Undefined array key "global_protection_id" in <b>/home/wikitechy/public_html/interview-questions/wp-content/plugins/content-protector/inc/class-ps-rest-handler.php</b> on line <b>51</b><br />
{"id":872,"date":"2021-07-18T14:37:30","date_gmt":"2021-07-18T14:37:30","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=872"},"modified":"2021-09-09T11:19:19","modified_gmt":"2021-09-09T11:19:19","slug":"what-is-python-threading","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/","title":{"rendered":"What is Python Threading ?"},"content":{"rendered":"<div class=\"TextHeading\">\n<div class=\"hddn\">\n<h2 id=\"python-threading\" class=\"color-purple\">Python Threading<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\">\n<div class=\"hddn\">\n<ul>\n<li>It is a light-weight process and they don\u2019t require more memory overhead they are less expensive than processes.<\/li>\n<li>A thread has a starting, an execution sequence, and a conclusion. It has an instruction pointer that monitors where inside its context it is currently running.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"Content\">\n<div class=\"hddn\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>It can be pre-interrupted.<\/li>\n<li>It can temporarily be put on hold (also called sleeping) while other threads are running &#8211; this is known as yielding.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"Content\">\n<div class=\"hddn\">\n<ul>\n<li>The newer threading module included with Python 2.4 provides much more powerful, high-level support for threads than the thread module.<\/li>\n<li>A Python threading module exposes all the methods of the thread module and it will give several extra methods.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"Content\">\n<div class=\"hddn\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>threading.activeCount() \u2013 It returns the number of thread objects that are active.<\/li>\n<li>threading.currentThread() \u2212 It returns the number of thread objects in the caller&#8217;s thread control.<\/li>\n<li>threading.enumerate() \u2212 It returns a list of all thread objects that are currently active.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"Content\">\n<div class=\"hddn\">\n<ul>\n<li>Additionally the methods, and thread module has thread class that implements threading. These methods provided by the Thread class are given below:<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"Content\">\n<div class=\"hddn\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>run() \u2212 This method is the entry point for a thread.<\/li>\n<li>start() \u2212 This method starts a thread by calling the run method.<\/li>\n<li>join([time]) \u2212 This waits for threads to terminate.<\/li>\n<li>isAlive() \u2212 This method checks whether a thread is still executing.<\/li>\n<li>getName() \u2212 This method returns the name of a thread.<\/li>\n<li>setName() \u2212 This method sets the name of a thread.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"ImageContent\">\n<div class=\"hddn\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-medium aligncenter\" src=\"https:\/\/cdn.wikitechy.com\/interview-questions\/python\/python-thread.png\" alt=\"Python thread\" width=\"400\" height=\"243\" \/><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Answer : It is a light-weight process and they don\u2019t require more memory overhead they are less expensive than processes.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"passster_activate_protection":false,"passster_protect_child_pages":"","passster_protection_type":"password","passster_password":"","passster_activate_overwrite_defaults":"","passster_headline":"","passster_instruction":"","passster_placeholder":"","passster_button":"","passster_id":"","passster_activate_misc_settings":"","passster_redirect_url":"","passster_hide":"no","passster_area_shortcode":"","gtb_hide_title":false,"gtb_wrap_title":false,"gtb_class_title":"","gtb_remove_headerfooter":false,"footnotes":""},"categories":[5608],"tags":[195,491,360,203,199,214,198,209,205,222,484,196,212,213,286,710,207,366,204,217,282,208,5766,5620,5617,5771,5776,5619,5770,5768,5769,5774,5618,5764,5777,5767,5780,5772,5773,5775,5762,5765,5779,5763,5778,483,206,200,197,280,364,5631],"class_list":["post-872","post","type-post","status-publish","format-standard","hentry","category-python","tag-accenture-interview-questions-and-answers","tag-applied-materials-interview-questions-and-answers","tag-atos-interview-questions-and-answers","tag-capgemini-interview-questions-and-answers","tag-casting-networks-india-pvt-limited-interview-questions-and-answers","tag-cgi-group-inc-interview-questions-and-answers","tag-chetu-interview-questions-and-answers","tag-collabera-technologies-interview-questions-and-answers","tag-dell-international-services-india-pvt-ltd-interview-questions-and-answers","tag-flipkart-interview-questions-and-answers","tag-genpact-interview-questions-and-answers","tag-ibm-interview-questions-and-answers","tag-indecomm-global-services-interview-questions-and-answers","tag-infosys-technologies-interview-questions-and-answers","tag-lt-infotech-interview-questions-and-answers","tag-mavenir-interview-questions-and-answers","tag-mphasis-interview-questions-and-answers","tag-netapp-interview-questions-and-answers","tag-oracle-corporation-interview-questions-and-answers","tag-peoplestrong-interview-questions-and-answers","tag-persistent-systems-interview-questions-and-answers","tag-prokarma-softech-pvt-ltd-interview-questions-and-answers","tag-python-create-thread","tag-python-data-science-interview-questions","tag-python-interview-questions-and-answers-for-testers","tag-python-multithreading","tag-python-multithreading-example","tag-python-programming-questions","tag-python-run-class-method-in-thread","tag-python-run-function-in-thread","tag-python-start-thread-in-background","tag-python-stop-thread","tag-python-telephonic-interview-questions","tag-python-thread-class","tag-python-thread-join","tag-python-thread-pool","tag-python-thread-sleep","tag-python-threading","tag-python-threading-example","tag-python-threading-lock","tag-python-threading-queue","tag-python-threading-return-value","tag-python-threading-timer","tag-python-threading-vs-multiprocessing","tag-python-threadpool","tag-reliance-industries-ltd-interview-questions-and-answers","tag-sap-labs-india-pvt-ltd-interview-questions-and-answers","tag-tech-mahindra-interview-questions-and-answers","tag-unitedhealth-group-interview-questions-and-answers","tag-virtusa-consulting-services-pvt-ltd-interview-questions-and-answers","tag-wells-fargo-interview-questions-and-answers","tag-xoriant-soluti-interview-questions-and-answers"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is Python Threading ? - Python Developer Interview Questions<\/title>\n<meta name=\"description\" content=\"What is Python Threading ? - python developer interview questions ? - It is a light-weight process and they don\u2019t require much memory overhead\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Python Threading ? - Python Developer Interview Questions\" \/>\n<meta property=\"og:description\" content=\"What is Python Threading ? - python developer interview questions ? - It is a light-weight process and they don\u2019t require much memory overhead\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-18T14:37:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-09T11:19:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.wikitechy.com\/interview-questions\/python\/python-thread.png\" \/>\n<meta name=\"author\" content=\"Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/\",\"name\":\"What is Python Threading ? - Python Developer Interview Questions\",\"isPartOf\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdn.wikitechy.com\/interview-questions\/python\/python-thread.png\",\"datePublished\":\"2021-07-18T14:37:30+00:00\",\"dateModified\":\"2021-09-09T11:19:19+00:00\",\"author\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757\"},\"description\":\"What is Python Threading ? - python developer interview questions ? - It is a light-weight process and they don\u2019t require much memory overhead\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/#primaryimage\",\"url\":\"https:\/\/cdn.wikitechy.com\/interview-questions\/python\/python-thread.png\",\"contentUrl\":\"https:\/\/cdn.wikitechy.com\/interview-questions\/python\/python-thread.png\"},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757\",\"name\":\"Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"caption\":\"Editor\"},\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Python Threading ? - Python Developer Interview Questions","description":"What is Python Threading ? - python developer interview questions ? - It is a light-weight process and they don\u2019t require much memory overhead","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/","og_locale":"en_US","og_type":"article","og_title":"What is Python Threading ? - Python Developer Interview Questions","og_description":"What is Python Threading ? - python developer interview questions ? - It is a light-weight process and they don\u2019t require much memory overhead","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/","og_site_name":"Wikitechy","article_published_time":"2021-07-18T14:37:30+00:00","article_modified_time":"2021-09-09T11:19:19+00:00","og_image":[{"url":"https:\/\/cdn.wikitechy.com\/interview-questions\/python\/python-thread.png"}],"author":"Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Editor","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/","name":"What is Python Threading ? - Python Developer Interview Questions","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/#primaryimage"},"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.wikitechy.com\/interview-questions\/python\/python-thread.png","datePublished":"2021-07-18T14:37:30+00:00","dateModified":"2021-09-09T11:19:19+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"description":"What is Python Threading ? - python developer interview questions ? - It is a light-weight process and they don\u2019t require much memory overhead","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/python\/what-is-python-threading\/#primaryimage","url":"https:\/\/cdn.wikitechy.com\/interview-questions\/python\/python-thread.png","contentUrl":"https:\/\/cdn.wikitechy.com\/interview-questions\/python\/python-thread.png"},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757","name":"Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","caption":"Editor"},"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=872"}],"version-history":[{"count":3,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/872\/revisions"}],"predecessor-version":[{"id":3237,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/872\/revisions\/3237"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}