join « pthread « C Q&A

Home
C Q&A
1.assembly
2.buffer
3.Card
4.Cast
5.compile
6.console
7.const
8.constructor
9.database
10.Date
11.Debug
12.Design
13.Development
14.DLL
15.encrypt
16.enum
17.eof
18.Event
19.fork
20.Format
21.gcc
22.gdb
23.graph
24.graphics
25.gui
26.Holiday Event
27.image
28.IP
29.iterator
30.macro
31.makefile
32.malloc
33.Menu
34.mysql
35.network
36.openssl
37.operator
38.password
39.pipe
40.preprocessor
41.printf
42.pthread
43.Regular expression
44.scanf
45.semaphore
46.SerialPort
47.server
48.Socket
49.sql
50.SQLserver
51.sscanf
52.std
53.stdin
54.stdout
55.stl
56.strcmp
57.stream
58.switch
59.Template
60.thread
61.timer
62.unix
63.video
64.Virtual
65.visualstudio
66.winapi
67.windows
68.xml
C Q&A » pthread » join 

1. thread termination issue (c programming)    stackoverflow.com

I'm working on an application for Linux in C which uses multiple threads. The threads which are spawned by the main function do most of the work, and therefore usually finish ...

2. pthread_exit and/or pthread_join causing Abort and SegFaults    stackoverflow.com

The following code is a simple thread game, that switches between threads causing the timer to decrease. It works fine for 3 threads, causes and Abort(core dumped) for 4 threads, and ...

3. Is it valid to call pthread_join on the main thread?    stackoverflow.com

Is the behavior of this code well-defined?

#include <stdio.h>
#include <pthread.h>

pthread_t mt;

void *start(void *x)
{
    void *y;
    pthread_join(mt, &y);
    printf("joined main thread\n");
    ...

4. pthreads - Join on group of threads, wait for one to exit    stackoverflow.com

In the POSIX thread interface, pthread_join(thread) can be used to block until the specified thread exits. Is there a similar function that will allow execution to block until any child thread exits? This ...

5. Difference between mutex lock and pthread_join    stackoverflow.com

What's the difference between the two? Aren't they the same thing in that they both wait for a thread to finish before executing another thread? I'm trying to understand the following code

#include <stdio.h>
#include ...

6. should we explicitly join a thread to finish    stackoverflow.com

should we explicitly join a thread to finish? I mean is this like process world: when we don't wait for them to finish we got zombie processes.

7. pthread_join on two infinite loop threads?    stackoverflow.com

I just read here that when the main loop ends, any threads that have or have not had a chance to spawn are terminated. So I need to do a ...

8. pthread create and join problems    cboard.cprogramming.com

Code: ************************************************* pthread_exit(NULL); //end of thread_function ************************************************* int res; int lots_of_threads; int num_sites; pthread_t a_thread[5]; void *thread_result; //initialise mutex - used to synchronise linked list between threads res = pthread_mutex_init(&queue_mutex, NULL); if (res != 0){printf("mutex creation failure.\n"); //add multiple threads for(lots_of_threads = 0; lots_of_threads < 5; lots_of_threads++) { //threads are created and started res = pthread_create(&(a_thread[lots_of_threads]), NULL, thread_function, (void *)lots_of_threads); if ...

9. Pthread_join causes a segfault    forums.devshed.com

I'm trying to set up the skeleton for a multithreaded program (in C, obviously...) Below is the code that creates the threads. THe threads are created properly, and execute properly. If I replace the pthread_join code below with a call to sleep(), everything works perfectly, but for some reason pthread_join causes a segfault. Code: matrixInfo matList[m]; matrixInfo *test; pthread_t threadList[m]; int ...

10. Output from thread after pthread_join !? Why??    forums.devshed.com

Hello everybody I fail to understand this artefact at all and I am wondering if someone can help. I'm using Debian etch, gcc 4.2.1 and compiling using the command Code: gcc -Wall -lpthread main.c -o threadtest This is the code: Code: #include #include #include #include #define THREADS 5 typedef struct ii_thdata { pthread_t th_id; pthread_attr_t *th_attr; } ...

11. Understanding and using void * and void ** in pthread_exit and pthread_join    forums.devshed.com

Hi Debian etch, gcc version 4.1.2 I'm having a bit of a problem returning data from a thread. This problem probably extends into a 'what is (void **) ?' question as well. I have one thread retrieving some data off a queue. Another thread (listening thread) receives data and then kicks off another thread (adding thread) to to add to the ...

12. Using/Omitting pthread_join()    daniweb.com

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.