I wrote some code in c, using pthread (I configured the linker and compiler in eclipse IDE first).
that works fine. However, when I move display_prompt to UI.h
no "Hello111 " output is printed.
anyone know how to solve that?
Elad
Hello,
you mean when you place the declaration of "display_prompt" to UI.h?
Declarations go in header(preprocessor #includes) and definitions go in the main source files by convention.
consider if the thread routine returns any void pointer while calling pthread_join,
the thread resources are freed and the thread will be terminated when the main thread is exit ,that is my assumption whether it is true
how do we find whether the thread is alive or terminated
how do we find... (0 Replies)
Hi all!
I am working on unix systems.I am programming in c.
I have got some problems with pthread.when I use pthread_create to creat a thread it says:
(.text+0x3a): undefined reference to `pthread_create'.
same is the problm with pthread_kill.
Can anyone help me out here.
Thanks.
vij. (2 Replies)
Hello all,
I'm working on a small wrapper library for a bigger project, and i've been killing my self over (what I think is) a pointer problem.
Here is the code (I extracted the part of the code where the problem is for better reading, I tested the code below, and I get the same problem):... (13 Replies)
Hello all.
I have made an application in C using pthreads. My problem is that my program seems to be only using 1 of my cores when I create multiple threads. I have 4 cores (Q9300). I am using Ubuntu 8.04.
I do believe the problem is that on linkage it's using a pthread emulation package... (4 Replies)
Hello,
I run my pthread code on Linux with 4 processors. However, the speed up is only 2 times.
The code is about solving equation (G+s(i)C)z(i)=B*us(i), i=1,...,n. Here G,C are m*m matrix, B*us(i) is a m*1 vector and s(i) are n different numbers. I need to solve the equation n times to... (2 Replies)
Hi all,
How can i parallize this code in pthread?
for(round=1;round<=16;round++)
{
Expansion(mid, 17 - round - 1, left);
Expansion(mid, round - 1, right);
round++;
Expansion(right, 17 - round - 1, mid);
Expansion(left, round - 1,mid);
}
Whereby each loop depend on the... (2 Replies)
I am so confused about the user threads and kernel threads.Suppose I created a thread using pthread create call in Linux ,whether it will be a user thread or kernel thread.If it user thread,then how its map to kernel thread.
I heard about the M:1,M:N,1:1 mapping methods.Which method linux is... (1 Reply)
I have a while loop like so:
while (counter (file1));
how can I pass that into a pthread_create()?
I was thinking ...
while(pthread_create(&path, NULL, counter, file));
is that right? (1 Reply)
Discussion started by: l flipboi l
1 Replies
LEARN ABOUT DEBIAN
pthread_equal
PTHREAD_EQUAL(3) Linux Programmer's Manual PTHREAD_EQUAL(3)NAME
pthread_equal - compare thread IDs
SYNOPSIS
#include <pthread.h>
int pthread_equal(pthread_t t1, pthread_t t2);
Compile and link with -pthread.
DESCRIPTION
The pthread_equal() function compares two thread identifiers.
RETURN VALUE
If the two thread IDs are equal, pthread_equal() returns a nonzero value; otherwise, it returns 0.
ERRORS
This function always succeeds.
CONFORMING TO
POSIX.1-2001.
NOTES
The pthread_equal() function is necessary because thread IDs should be considered opaque: there is no portable way for applications to
directly compare two pthread_t values.
SEE ALSO pthread_create(3), pthread_self(3), pthreads(7)COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2009-03-30 PTHREAD_EQUAL(3)