title: Workqueue implementation in Linux Kernel
body: <p>Can any one help me to understand difference between below mentioned APIs in Linux kernel:</p>
  
  <pre><code>struct workqueue_struct *create_workqueue(const char *name); 
  struct workqueue_struct *create_singlethread_workqueue(const char *name);
  </code></pre>
  
  <p>I had written sample modules, when I try to see them using <code>ps -aef</code>, both have created a workqueue, but I was not able to see any difference.</p>
  
  <p>I have referred to <a href="http://www.makelinux.net/ldd3/chp-7-sect-6" rel="nofollow noreferrer">http://www.makelinux.net/ldd3/chp-7-sect-6</a>, and according to LDD3:</p>
  
  <blockquote>
    <p>If you use <strong>create_workqueue</strong>, you get a workqueue that has a <strong>dedicated thread for each processor</strong> on the system. In many cases, all those threads are simply overkill; if a single worker thread will suffice, create the workqueue with create_singlethread_workqueue instead.</p>
  </blockquote>
  
  <p>But I was not able to see multiple worker threads (each for a processor).</p>