{"id":2036,"date":"2021-01-08T16:23:07","date_gmt":"2021-01-08T10:53:07","guid":{"rendered":"https:\/\/binaryterms.com\/?p=2036"},"modified":"2021-01-15T16:31:16","modified_gmt":"2021-01-15T11:01:16","slug":"thread-libraries-in-os","status":"publish","type":"post","link":"https:\/\/binaryterms.com\/thread-libraries-in-os.html","title":{"rendered":"Thread Libraries in OS"},"content":{"rendered":"<p><strong>Thread Libraries<\/strong> has a collection of functions that useful in creating and controlling threads. Programmers can access these thread libraries using an application programming interface (API). Thread libraries can be the <em>user level library<\/em> or <em>kernel level library<\/em>.<\/p>\n<p>If the thread library is implemented at the userspace then code and data of the thread library would reside in user space. In this case, invoking any function from thread library would be a simple function call and it won\u2019t be a system call.<\/p>\n<p>If the thread library is implemented at the kernel space then code and data of the library would reside in the kernel space and would be supported by the operating system. In this case, invoking a function from thread library would be a system call to the kernel. In the section further, we would be discussing three kinds of thread libraries.<\/p>\n<h2>Thread Libraries in Operating System<\/h2>\n<ol>\n<li><a href=\"#PthreadsLibrary\">PthreadsLibrary<\/a><\/li>\n<li><a href=\"#Win32Library\">Win32 Library<\/a><\/li>\n<li><a href=\"#JavaLibrary\">Java Library<\/a><\/li>\n<\/ol>\n<p><a name=\"PthreadsLibrary\"><\/a><\/p>\n<h3>Pthread Library<\/h3>\n<p>Pthreads are also termed as <strong>POSIX<\/strong> thread library. This can be implemented either at the <em>userspace<\/em> or at the <em>kernel space<\/em>. Pthreads library is often implemented at LINUX, UNIX, Solaris, Mac OSX. The Pthread program must always have a <strong>pthread.h<\/strong> header file.<\/p>\n<p>To get the basic understanding of how the Pthread is invoked, how the control of the program passes to thread and how the thread get destroyed after completing the operation we will overview a multithreaded program that calculates the summation of nonnegative integers.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\" data-enlighter-linenumbers=\"false\">#include &lt;pthread.h&gt;\r\n#include &lt;stdio.h&gt;\r\nint sum;\u00a0 \u00a0 \/* this data is shared by the thread(s) *\/\r\nvoid *runner(void *param);\u00a0 \u00a0 \/* the thread *\/\r\nint main(int argc, char *argv[])\r\n{\r\npthread_t tid;\u00a0 \u00a0 \/* the thread identifier *\/\r\npthread_attr_t attr;\u00a0 \u00a0 \/* set of thread attributes *\/\r\nif (argc != 2) {\r\n}\r\nfprintf(stderr,\"usage: a.out &lt;integer value&gt;\\n\");\r\nreturn -1;\r\n}\r\nif (atoi(argv[1]) &lt; 0) {\r\nfprintf(stderr,\"%d must be&gt;= 0\\n\",atoi(argv[1]));\r\nreturn -1;\r\n}\r\npthread_attr_init(&amp;attr);\u00a0 \u00a0 \/* get the default attributes *\/\r\npthread_create(&amp;tid,&amp;attr,runner,argv[1]);\u00a0 \u00a0 \/* create the thread *\/\r\npthread_join(tid,NULL);\u00a0 \u00a0 \/* wait for the thread to exit *\/\r\nprintf(\"sum = %d\\n\",sum);\r\n}\r\nvoid *runner(void *param)\u00a0 \u00a0 \/* The thread will begin control in this function *\/\r\n{\r\ninti, upper= atoi(param);\r\nsum = 0;\r\nfor (i = 1; i &lt;= upper; i++)\r\nsum += i;\r\npthread_exi t ( 0) ;\r\n}<\/pre>\n<p><strong>Work Flow of Pthread Program<\/strong><\/p>\n<p>The variable sum is the global data that would be shared by all the threads in the program.<\/p>\n<ol>\n<li>The program starts with the main() where it accepts two arguments, first is the argument count and second the argument vector i.e. the string of characters.<\/li>\n<li>Then it executes the pthread_t tid, this command would generate the <em>thread id <\/em>you would be creating.<\/li>\n<li>Then the next statement that would be executed is pthread_attr_t attr which makes the declaration of thread attributes.<\/li>\n<li>Now this statement if (argc != 2) verifies that argument count is not equal to 2.<\/li>\n<li>The statement if (atoi(argv[1]) &lt; 0) first converts the value of argv[1] to integer and verifies that it is greater than 0. The command \u2018atoi\u2019 is for converting the array to an integer.<\/li>\n<li>The statement pthread_attr_init(&amp;attr) initiates the default thread attributes.<\/li>\n<li>The command pthread_create(&amp;tid,&amp;attr,runner,argv[1]) would create a thread. The created thread accepts four arguments first is thread_id this means the created thread is associated to the thread id declared in step 2, with the second argument it accepts the default thread arguments, with the third argument we pass the name of the function where the thread has to begin the execution from here the function is a <strong>runner<\/strong> and at last we pass the integer argument that we provided to the program at the command line.<\/li>\n<li>Now we have two threads the initial thread of main() and the next thread executing runner(). For now, the execution of main() thread is put on hold as it calls the function pthread_join(tid,NULL) this function transfers the control to the thread with thread id \u2018tid\u2019 i.e. the thread created to execute runner() function.<\/li>\n<li>The runner() function will complete the summation operation and would get terminated by calling the function pthread_exi t ( 0) which would again transfer the control to main() and print the summation value.<\/li>\n<\/ol>\n<p>So the functions we used above i.e. pthread_attr_init(&amp;attr), pthread_create(&amp;tid,&amp;attr,runner,argv[1]), pthread_join(tid,NULL), pthread_exi t ( 0) are the functions in Pthread library we used to create and manage threads.<br \/>\n<a name=\"Win32Library\"><\/a><\/p>\n<h3>Win32 Library<\/h3>\n<p>Creation of thread in Win2 library is similar to pthread library. To create a thread using the Win32 library always include <strong>windows.h<\/strong> header file in the program. The Win32 thread library is a <em>kernel-level<\/em> library which means invoking the Win32 library function results in a system call.<\/p>\n<p>Now we will see how we can create and manage threads using the functions in Win32 thread library.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\" data-enlighter-linenumbers=\"false\">#include &lt;Windows.h&gt;\r\n#include &lt;stdio.h&gt;\r\nDWORD Sum;\u00a0 \u00a0 \/* data is shared by the thread(s) *\/\r\nDWORD WINAPI Sumrnation(LPVOID Param)\u00a0 \u00a0 \/* the thread runs in this separate function *\/\r\n{\r\nDWORD Upper = *(DWORD*)Param;\r\nfor (DWORD i = 0; i &lt;= Upper; i++)\r\nSum += i;\r\nreturn 0;\r\n}\r\nint main(int argc, char *argv[])\r\n{\r\nDWORD Threadid;\r\nHANDLE ThreadHandle;\r\nint Param;\r\n\/* perform some basic error checking *\/\r\nif (argc != 2) {\r\nfprintf(stderr,\"An integer parameter is required\\n\");\r\nreturn -1;\r\n}\r\nParam = atoi(argv[1]);\r\nif (Param &lt; 0) {\r\nfprintf(stderr,\"An integer&gt;= 0 is required\\n\");\r\nreturn -1;\r\n}\r\n\/* create the thread*\/\r\nThreadHandle = CreateThread(\r\nNULL, \/*default security attributes*\/\r\n0, \/*default stack size*\/\r\nSummation, \/* thread function*\/\r\n&amp;Param, \/*parameter to the thread function*\/\r\n0, \/*default creation flags*\/\r\n&amp;Threadid); \/* returns the thread identifier*\/\r\nif (ThreadHandle != NULL)\r\n{\r\n\/* now wait for the thread to finish*\/\r\nWaitForSingleObject(ThreadHandle,INFINITE);\r\n\/* close the thread handle*\/\r\nCloseHandle(ThreadHandle);\r\nprintf(\"surn = %d\\n\" ,Sum);\r\n}\r\n}<\/pre>\n<p><strong>Workflow in Win32 Program<\/strong><\/p>\n<p>In the program below the variable sum has the global data shared by all the threads in the program.<\/p>\n<ol>\n<li>The execution of the program starts with the main() function which accepts two arguments first is the argument count and second is the argument vector i.e. the string of characters.<\/li>\n<li>The next statement DWORD Threadid declares the thread id which would be created further in this program.<\/li>\n<li>The statement HANDLE ThreadHandle creates a pointer \u2018ThreadHandle\u2019 that will be used to access the Win32 library functions.<\/li>\n<li>The next two if statements perform some basic error checking.<\/li>\n<li>The statement ThreadHandle = CreateThread(NULL, 0, Summation, &amp;Param, 0, &amp;Threadid) creates a thread and gives its reference to ThreadHandle.<br \/>\nThe CreateThread() function accept six arguments where Null is for default security attributes, 0 is the default stack size, Summation is the separate thread function, &amp;Param is the parameters to thread function, 0 is default flag creation and ThreadID is the id of the thread that is to be associated to the Summation thread function.<\/li>\n<li>The next if function waits for the Summation thread to get complete with the function WaitForSingleObject(ThreadHandle, INFINITE) and once it gets complete the thread is terminated with CloseHandle(ThreadHandle) function. Finally, the sum is displayed.<\/li>\n<\/ol>\n<p>So here, the functions CreateThread(), WaitForSingleObject(), CloseHandle() are the function in Win32 thread library which are used to create and manage threads.<br \/>\n<a name=\"JavaLibrary\"><\/a><\/p>\n<h3>Java Thread Library<\/h3>\n<p>You must have seen that mostly the java virtual machine JVM runs on the top of the host operating system. That\u2019s why java threads are created and controlled by using the available library at the host operating system.<\/p>\n<p>Therefore, in the Windows operating system, the java threads are implemented using Win32 API and in operating systems such as Linux and UNIX, the java thread is implemented using Pthread library. In a Java program, there is at least one thread of control. Well, there are two methods to creating a thread in Java program first you can derive a new class from a Thread class and override it&#8217;s run() method. The second method is to define a class and implement a Runnable interface to it, the second method is the most common method to be used.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-linenumbers=\"false\">class Sum\r\n{\r\nprivate int sum;\r\npublic int getSum() {\r\nreturn sum;\r\n}\r\npublic void setSum(int sum) {\r\nthis.sum sum;\r\n}\r\n}\r\nclass Summation implements Runnable\r\n{\r\nprivate int upper;\r\nprivate Sum sumValue;\r\npublic Summation(int upper, Sum sumValue) {\r\nthis.upper = upper;\r\nthis.sumValue = sumValue;\r\n}\r\npublic void run() {\r\nint sum = 0;\r\nfor (int i = 0; i &lt;= upper; i++)\r\nsum += i;\r\nsumValue.setSum(sum);\r\n}\r\n}\r\npublic class Driver\r\n{\r\npublic static void main(String[] args) {\r\nif (args.length &gt; 0) {\r\nif (Integer.parseint(args[O]) &lt; 0)\r\nSystem.err.println(args[O] + \"must be&gt;= 0.\");\r\nelse {\r\nII create the object to be shared\r\nSum sumObject = new Sum();\r\nint upper= Integer.parseint(args[O]);\r\nThread thrd =new Thread(new Summation(upper, sumObject));\r\nthrd.start();\r\ntry {\r\nthrd. join () ;\r\nSystem.out.println\r\n(\"The sum of \"+upper+\" is \"+sumObject.getSum());\r\n} catch (InterruptedException ie) { }\r\n}\r\n}\r\nelse\r\nSystem.err.println(\"Usage: Summation &lt;integer value&gt;\"); }\r\n}<\/pre>\n<p><strong>Workflow of the Java Program<\/strong><\/p>\n<p>The Java program above has three classes Sum, Summation and the Driver class. The Sum class has two methods, the getSum() method returns the sum value and the setSum() method assigns a value to sum variable. The Summation class has the logic that has to be run by the thread. The Driver class is the main class of execution.<\/p>\n<p>Now let us understand the creation and execution of the thread in the Java program above.<\/p>\n<ol>\n<li>From the command line, you have entered the argument value let us suppose 5 which is passed to the main() method. The main method accepts the argument into the string vector.<\/li>\n<li>The first if statement checks the user passed argument length and we know it greater than 0.<\/li>\n<li>It further checks that if the args[0] (which is 5 in our case) is less than 0 by converting that string to integer (as the main has accepted the argument into string vector). If the args[0] is less than 0 then an error is displayed.<br \/>\nBut as in our case, the args[0] (i.e. 5) is not less than 0 the else statement is executed<\/li>\n<li>The else statement creates an object for Sum class i.e. sumObject.<\/li>\n<li>Now in a local integer variable \u2018upper\u2019 the value of args[0] is assigned by using parseInt() method which converts the string to an integer.<\/li>\n<li>Next, a thread object <strong>thrd <\/strong>is created next we have to pass Summation runnable instance to it. As the Summation instance, it created its constructor would be executed, to its constructor, we have passed two arguments variable upper i.e. 5 and an object of Sum class i.e. sumObject. The constructor Summation would assign the values accepted in its argument to its instance variable. Now invoking <strong>thrd.start() creates a new thread<\/strong> which executes run() of Summation class as it is implemented using Runnable interface.<\/li>\n<li>The run() method calculates the sum of the first 5 natural numbers and sets the sum value to an instance variable <strong>sum <\/strong>of Sum class and control return back to main() again.<\/li>\n<li>The thrd.join() method has blocked the execution of rest of the main() until the threads have completed its execution. Next, the value of sum is printed.<\/li>\n<\/ol>\n<p>In the Java program above there were two threads one executes the main() and other executes the run().<\/p>\n<p>So these are the three thread libraries that can be used to create and manage threads. In Win32 and Pthread thread libraries, the threads can easily share the data as the data can be declared globally. But this is not the case with java program. As Java is an object-oriented language there is no concept of the global variable instead the reference of a variable to be shared is passed to the required thread.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Thread Libraries has a collection of functions that useful in creating and controlling threads. Programmers can access these thread libraries using an application programming interface (API). Thread libraries can be the user level library or kernel level library. If the thread library is implemented at the userspace then code and data of the thread library [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[2],"tags":[],"class_list":{"0":"post-2036","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-operating-system","7":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What are Thread Libraries in OS? Pthread, Win32, Java - Binary Terms<\/title>\n<meta name=\"description\" content=\"Thread Libraries has a collection of functions that we can use to create and manage threads. Thread libraries can be implemented at user or kernel level.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/binaryterms.com\/thread-libraries-in-os.html\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What are Thread Libraries in OS? Pthread, Win32, Java - Binary Terms\" \/>\n<meta property=\"og:description\" content=\"Thread Libraries has a collection of functions that we can use to create and manage threads. Thread libraries can be implemented at user or kernel level.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/binaryterms.com\/thread-libraries-in-os.html\" \/>\n<meta property=\"og:site_name\" content=\"Binary Terms\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-08T10:53:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-15T11:01:16+00:00\" \/>\n<meta name=\"author\" content=\"Neha T\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Neha T\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/binaryterms.com\/thread-libraries-in-os.html#article\",\"isPartOf\":{\"@id\":\"https:\/\/binaryterms.com\/thread-libraries-in-os.html\"},\"author\":{\"name\":\"Neha T\",\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe\"},\"headline\":\"Thread Libraries in OS\",\"datePublished\":\"2021-01-08T10:53:07+00:00\",\"dateModified\":\"2021-01-15T11:01:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/binaryterms.com\/thread-libraries-in-os.html\"},\"wordCount\":1508,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/binaryterms.com\/#organization\"},\"articleSection\":[\"Operating System\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/binaryterms.com\/thread-libraries-in-os.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/binaryterms.com\/thread-libraries-in-os.html\",\"url\":\"https:\/\/binaryterms.com\/thread-libraries-in-os.html\",\"name\":\"What are Thread Libraries in OS? Pthread, Win32, Java - Binary Terms\",\"isPartOf\":{\"@id\":\"https:\/\/binaryterms.com\/#website\"},\"datePublished\":\"2021-01-08T10:53:07+00:00\",\"dateModified\":\"2021-01-15T11:01:16+00:00\",\"description\":\"Thread Libraries has a collection of functions that we can use to create and manage threads. Thread libraries can be implemented at user or kernel level.\",\"breadcrumb\":{\"@id\":\"https:\/\/binaryterms.com\/thread-libraries-in-os.html#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/binaryterms.com\/thread-libraries-in-os.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/binaryterms.com\/thread-libraries-in-os.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/binaryterms.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Thread Libraries in OS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/binaryterms.com\/#website\",\"url\":\"https:\/\/binaryterms.com\/\",\"name\":\"Binary Terms\",\"description\":\"The Computer Science &amp; IT Guide\",\"publisher\":{\"@id\":\"https:\/\/binaryterms.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/binaryterms.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/binaryterms.com\/#organization\",\"name\":\"Binary Terms\",\"url\":\"https:\/\/binaryterms.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png\",\"contentUrl\":\"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png\",\"width\":400,\"height\":63,\"caption\":\"Binary Terms\"},\"image\":{\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe\",\"name\":\"Neha T\",\"url\":\"https:\/\/binaryterms.com\/author\/author\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What are Thread Libraries in OS? Pthread, Win32, Java - Binary Terms","description":"Thread Libraries has a collection of functions that we can use to create and manage threads. Thread libraries can be implemented at user or kernel level.","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:\/\/binaryterms.com\/thread-libraries-in-os.html","og_locale":"en_GB","og_type":"article","og_title":"What are Thread Libraries in OS? Pthread, Win32, Java - Binary Terms","og_description":"Thread Libraries has a collection of functions that we can use to create and manage threads. Thread libraries can be implemented at user or kernel level.","og_url":"https:\/\/binaryterms.com\/thread-libraries-in-os.html","og_site_name":"Binary Terms","article_published_time":"2021-01-08T10:53:07+00:00","article_modified_time":"2021-01-15T11:01:16+00:00","author":"Neha T","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Neha T","Estimated reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/binaryterms.com\/thread-libraries-in-os.html#article","isPartOf":{"@id":"https:\/\/binaryterms.com\/thread-libraries-in-os.html"},"author":{"name":"Neha T","@id":"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe"},"headline":"Thread Libraries in OS","datePublished":"2021-01-08T10:53:07+00:00","dateModified":"2021-01-15T11:01:16+00:00","mainEntityOfPage":{"@id":"https:\/\/binaryterms.com\/thread-libraries-in-os.html"},"wordCount":1508,"commentCount":0,"publisher":{"@id":"https:\/\/binaryterms.com\/#organization"},"articleSection":["Operating System"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/binaryterms.com\/thread-libraries-in-os.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/binaryterms.com\/thread-libraries-in-os.html","url":"https:\/\/binaryterms.com\/thread-libraries-in-os.html","name":"What are Thread Libraries in OS? Pthread, Win32, Java - Binary Terms","isPartOf":{"@id":"https:\/\/binaryterms.com\/#website"},"datePublished":"2021-01-08T10:53:07+00:00","dateModified":"2021-01-15T11:01:16+00:00","description":"Thread Libraries has a collection of functions that we can use to create and manage threads. Thread libraries can be implemented at user or kernel level.","breadcrumb":{"@id":"https:\/\/binaryterms.com\/thread-libraries-in-os.html#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/binaryterms.com\/thread-libraries-in-os.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/binaryterms.com\/thread-libraries-in-os.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/binaryterms.com\/"},{"@type":"ListItem","position":2,"name":"Thread Libraries in OS"}]},{"@type":"WebSite","@id":"https:\/\/binaryterms.com\/#website","url":"https:\/\/binaryterms.com\/","name":"Binary Terms","description":"The Computer Science &amp; IT Guide","publisher":{"@id":"https:\/\/binaryterms.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/binaryterms.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/binaryterms.com\/#organization","name":"Binary Terms","url":"https:\/\/binaryterms.com\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/","url":"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png","contentUrl":"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png","width":400,"height":63,"caption":"Binary Terms"},"image":{"@id":"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe","name":"Neha T","url":"https:\/\/binaryterms.com\/author\/author"}]}},"_links":{"self":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts\/2036","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/comments?post=2036"}],"version-history":[{"count":24,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts\/2036\/revisions"}],"predecessor-version":[{"id":2104,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts\/2036\/revisions\/2104"}],"wp:attachment":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/media?parent=2036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/categories?post=2036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/tags?post=2036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}