Hi, when I write the pthread_create() and pthread_join in this way, then the program is OK.
However, I require to design the architecture like
In my requirement, once some events or signals come, then a thread is created for handle it; if no events then no thread is created.
There's no reason to start a separate thread if all you're going to do is call pthread_join() and wait for it to finish.
Hello,
J create a thread C with a JNI function via JAVA.
J have the following message (but not in each time):
Someone has an idea ?
Thank.
Unexpected Signal : 4 occurred at PC=0x78C103E0
Function=
Library=(N/A)
NOTE: We are unable to locate the function name... (0 Replies)
Discussion started by: AUBERT
0 Replies
2. Post Here to Contact Site Administrators and Moderators
I am unable to open the mimesender thread. I get the following message when clicking on https://www.unix.com/showthread.php?p=33233#post33233 : (2 Replies)
hi all,
my requirement is to create a thread by calling another function.
i.e i dont call pthread_create directly from main, but by calling another function (createThd - below ), from main.
Example:
void *thread_function(void *arg) { /* thread function */
int i;
rc =... (3 Replies)
Discussion started by: wolwy_pete
3 Replies
4. Forum Support Area for Unregistered Users & Account Problems
I try to initial a UDP client from threading, but it doesn't work? why?
These codes from the textbook
#define ECHOMAX 255 /* Longest string to echo */
#define TIMEOUT_SECS 2 /* Seconds between retransmits */
#define MAXTRIES 5 /* Tries before giving up */... (3 Replies)
As I know threads share the memory. But, what about the local variables in the thread function? if i call multiple threads would they allocate seperate local variables for themselves?
like
thread_func()
{
int i, j;
string...
}
Are the above local variables defined for each of... (1 Reply)
Hello,
I hope you can help me with my problem.
I've written a programm which creates a thread. The main programmm creates 10 int and float values. The fucnction should give the values out.
May big problem ist that the delivery to the function is not working.
Where ist my fault?
How can I make... (1 Reply)
Discussion started by: jimm_the_h
1 Replies
8. Forum Support Area for Unregistered Users & Account Problems
I am unable to post reply to a thread. Whenever I will reply to any post I get the message every time :
The message you have entered is too short. Please lengthen your message to at least 5 characters.
Even though length of the message is more than required.
for example I tried to post
... (3 Replies)
Discussion started by: Unregistered
3 Replies
9. Forum Support Area for Unregistered Users & Account Problems
Hi.
I registered, but when trying to post, I get ...
"Sorry, you do not have enough Bits to post a new thread"
Google & Forum search showed some hits, but no solution.
Please advide.
Thanks! (1 Reply)
Hi Experts,
Am writing a code which need to check for the previous day date and pickup the file as per the previous day date.
Problem: Why variable "YDATE" is empty ?
O/S: RHEL 5.6
Shell: BASH
Desired O/P: ls -lrt /opt/test/user/atsuser.NHU/out/demon.08272017
When I checked the... (3 Replies)
Discussion started by: pradeep84in
3 Replies
LEARN ABOUT OPENSOLARIS
pthread_join
pthread_join(3C) Standard C Library Functions pthread_join(3C)NAME
pthread_join - wait for thread termination
SYNOPSIS
cc -mt [ flag... ] file... -lpthread [ library... ]
#include <pthread.h>
int pthread_join(pthread_t thread, void **status);
DESCRIPTION
The pthread_join() function suspends processing of the calling thread until the target thread completes. thread must be a member of the
current process and it cannot be a detached thread. See pthread_create(3C).
If two or more threads wait for the same thread to complete, all will suspend processing until the thread has terminated, and then one
thread will return successfully and the others will return with an error of ESRCH. The pthread_join() function will not block processing of
the calling thread if the target thread has already terminated.
If a pthread_join() call returns successfully with a non-null status argument, the value passed to pthread_exit(3C) by the terminating
thread will be placed in the location referenced by status.
If the pthread_join() calling thread is cancelled, then the target thread will remain joinable by pthread_join(). However, the calling
thread may set up a cancellation cleanup handler on thread prior to the join call, which may detach the target thread by calling
pthread_detach(3C). See pthread_detach(3C) and pthread_cancel(3C).
RETURN VALUES
If successful, pthread_join() returns 0. Otherwise, an error number is returned to indicate the error.
ERRORS
EDEADLK A joining deadlock would occur, such as when a thread attempts to wait for itself.
EINVAL The thread corresponding to the given thread ID is a detached thread.
ESRCH No thread could be found corresponding to the given thread ID.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO pthread_cancel(3C), pthread_create(3C), pthread_detach(3C), pthread_exit(3C), wait(3C), attributes(5), standards(5)NOTES
The pthread_join(3C) function must specify the thread ID for whose termination it will wait.
Calling pthread_join() also "detaches" the thread; that is, pthread_join() includes the effect of the pthread_detach() function. If a
thread were to be cancelled when blocked in pthread_join(), an explicit detach would have to be performed in the cancellation cleanup han-
dler. The pthread_detach() function exists primarily for this purpose.
SunOS 5.11 23 Mar 2005 pthread_join(3C)