Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #87573

Re: Creating Threads

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: Creating Threads
Date 2016-05-10 08:54 -0700
Organization None to speak of
Message-ID <lnzirxsyca.fsf@kst-u.example.com> (permalink)
References <e2922efd-710c-4ced-8d07-f71ea70cedfc@googlegroups.com>

Show all headers | View raw


janus <emekamicro@gmail.com> writes:
> What is the difference between the below options?
>
> options (1)
> pthread_t con;
>  for (i = 0; i < WAFER_THREADS; i++) {
>         pthread_create(&con, NULL, &worker_thread, fifo);
> }
>
>
> options (2)
> pthread_t con[WAFER_THREADS];
>  for (i = 0; i < WAFER_THREADS; i++) {
>         pthread_create(&con[i], NULL, &worker_thread, fifo);
> }

pthread_t is defined by POSIX, not by C.  I suggest asking in
comp.unix.programmer or comp.programming.threads (I don't know
whether the latter is still active).

C11 has optional threading support, similar to POSIX threads.
If you wanted to ask about that, this would be the right place.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Creating Threads janus <emekamicro@gmail.com> - 2016-05-10 04:49 -0700
  Re: Creating Threads Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-05-10 04:59 -0700
  Re: Creating Threads Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-10 08:00 -0400
    Standards (Was: Creating Threads) gazelle@shell.xmission.com (Kenny McCormack) - 2016-05-10 12:33 +0000
      Re: Standards (Was: Creating Threads) Randy Howard <rhoward.mx@EverybodyUsesIt.com> - 2016-05-10 12:39 -0500
        Re: Standards (Was: Creating Threads) Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-10 14:22 -0400
          Re: Standards (Was: Creating Threads) janus <emekamicro@gmail.com> - 2016-05-11 14:12 -0700
            Re: Standards (Was: Creating Threads) Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-11 20:23 -0400
              Re: Standards (Was: Creating Threads) supercat@casperkitty.com - 2016-05-12 09:26 -0700
      Re: Standards <william@wilbur.25thandClement.com> - 2016-05-12 12:33 -0700
  Re: Creating Threads Keith Thompson <kst-u@mib.org> - 2016-05-10 08:54 -0700

csiph-web