Sponsored Content
Full Discussion: Use fork() in thread
Top Forums UNIX for Advanced & Expert Users Use fork() in thread Post 302256956 by fpmurphy on Tuesday 11th of November 2008 01:03:46 AM
Old 11-11-2008
Quote:
Also Programming with POSIX® Threads by David R. Butenhof explains much of what I needed.
An excellent book. Dave was deeply involved with the development of POSIX.1c.

I note that you mention that you will be developing for both Solaris and Linux. Linux has a number of threading models as does Solaris and the threads implementations vary depending on the particular OS version your application is running on. Test and test again!
 

4 More Discussions You Might Find Interesting

1. Programming

How to cancel a thread safely from the initial thread?

how about asynchronous canceling? or with signal? if with signal whether it effects the process? my english so badly :( :( (1 Reply)
Discussion started by: alan.zhao
1 Replies

2. Programming

Parent Thread Of Child Thread

Parent Thread Of Child Thread Suppose a process creates some threads say threadC and threadD. Later on each of these threads create new child threads say threadC1, threadC2, threadC3 etc. So a tree of threads will get created. Is there any way to find out the parent thread of one such... (1 Reply)
Discussion started by: rupeshkp728
1 Replies

3. Programming

Fork thread, Assertion failed. X11.

Hi all. I wrote a program with the Motif Widget Toolkit. It has a button and a scrollbar. When the user hits the button the callback creates a new fork() thread. The new thread sleeps for a while and then changes the position of the scrollbar. It does this in an endless loop. I need the... (2 Replies)
Discussion started by: mghis
2 Replies

4. Forum Support Area for Unregistered Users & Account Problems

Not able to post thread/reply to thread

Dear Moderator I am not able to post any new thread or post reply to mine old thread. Kindly help as i am stuck on one problem and needed suggestion. Regards Jaydeep (1 Reply)
Discussion started by: jaydeep_sadaria
1 Replies
PTHREAD_SETCONCURRENCY(3)				     Linux Programmer's Manual					 PTHREAD_SETCONCURRENCY(3)

NAME
pthread_setconcurrency, pthread_getconcurrency - set/get the concurrency level SYNOPSIS
#include <pthread.h> int pthread_setconcurrency(int new_level); int pthread_getconcurrency(void); Compile and link with -pthread. DESCRIPTION
The pthread_setconcurrency() function informs the implementation of the application's desired concurrency level, specified in new_level. The implementation only takes this as a hint: POSIX.1 does not specify the level of concurrency that should be provided as a result of calling pthread_setconcurrency(). Specifying new_level as 0 instructs the implementation to manage the concurrency level as it deems appropriate. pthread_getconcurrency() returns the current value of the concurrency level for this process. RETURN VALUE
On success, pthread_setconcurrency() returns 0; on error, it returns a nonzero error number. pthread_getconcurrency() always succeeds, returning the concurrency level set by a previous call to pthread_setconcurrency(), or 0, if pthread_setconcurrency() has not previously been called. ERRORS
pthread_setconcurrency() can fail with the following error: EINVAL new_level is negative. POSIX.1-2001 also documents an EAGAIN error ("the value specified by new_level would cause a system resource to be exceeded"). VERSIONS
These functions are available in glibc since version 2.1. CONFORMING TO
POSIX.1-2001. NOTES
The default concurrency level is 0. Concurrency levels are only meaningful for M:N threading implementations, where at any moment a subset of a process's set of user-level threads may be bound to a smaller number of kernel-scheduling entities. Setting the concurrency level allows the application to give the system a hint as to the number of kernel-scheduling entities that should be provided for efficient execution of the application. Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the concurrency level has no meaning. In other words, on Linux these functions merely exist for compatibility with other systems, and they have no effect on the execution of a program. SEE ALSO
pthread_attr_setscope(3), pthreads(7) COLOPHON
This page is part of release 3.25 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-04-10 PTHREAD_SETCONCURRENCY(3)
All times are GMT -4. The time now is 08:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy