Sponsored Content
Full Discussion: POSIX threads
Top Forums Programming POSIX threads Post 302100019 by !_30 on Friday 15th of December 2006 11:27:01 AM
Old 12-15-2006
Oh yes , I figure it out.

Thanks again !
 

9 More Discussions You Might Find Interesting

1. BSD

Posix queues

Hi! Everybody%) I got a question like this: Does my FreeBSD5.1 support Posix queues. Thanks! (7 Replies)
Discussion started by: kamazi
7 Replies

2. UNIX for Dummies Questions & Answers

how to read POSIX?

how to read POSIX? poe six or not? (3 Replies)
Discussion started by: robin.zhu
3 Replies

3. UNIX for Advanced & Expert Users

Threads and Threads Count ?

Hi all, How can I get the list of all Threads and the Total count of threads under a particular process ? Do suggest !! Awaiting for the replies !! Thanks Varun:b: (2 Replies)
Discussion started by: varungupta
2 Replies

4. Programming

Posix

HI, When i am configuring php in SUN Solaris. I am getting the below error. configure: error: Your system seems to lack POSIX threads. Do i need to install POSIX? If so can somebody let me know where can i download POSIX for Solaris 8? Thanks, (2 Replies)
Discussion started by: Krrishv
2 Replies

5. Programming

POSIX threads and data safety

I created multiple POSIX threads (on readhat Linux) in a C program in my app. What I am doing is - I am creating threads equal to the number of CPUs in the system and and equal number of instances of a certain data structure, basically a queue implementation. I am assigning one ID to the thread... (2 Replies)
Discussion started by: radiatejava
2 Replies

6. UNIX for Advanced & Expert Users

Posix threads

Hi, consider the code below: #include <stdio.h> . . struct myStruct { char *message ; int id; }; . . . void *thread_function( void *ptr ); nt main() { pthread_t thread1, thread2 ,thread3 ; struct myStruct nico1; (2 Replies)
Discussion started by: Behnaz
2 Replies

7. Programming

need help with posix threads

Hi, I am new to posix threads. The no of threads to be created depends on the runtime. If I get the number of threads, I need to forward declare pthread_t mythread; how to do that can I use pointers and use malloc()?? I also have another question. The pthread_join is used to make... (0 Replies)
Discussion started by: brett01
0 Replies

8. UNIX for Advanced & Expert Users

Linkage of POSIX threads function calls

I wonder if someone knows what is the rationale behind linking function calls of the POSIX threads library at link-time vs. run-time. For example, if I create the following program: #include <pthread.h> void noop() { return; } int main() { pthread_self(); pthread_atfork(noop,... (1 Reply)
Discussion started by: jsimsa
1 Replies

9. UNIX for Advanced & Expert Users

Change value for POSIX

Hi, I have a VM with following configration . 3.10.0-693.1.1.el7.x86_64 #1 SMP Thu Aug 3 08:15:31 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux My current POSIX is :-- Your environment variables take up 2011 bytes POSIX upper limit on argument length (this system): 2093093 POSIX smallest... (15 Replies)
Discussion started by: Abhayman
15 Replies
door_server_create(3DOOR)				      Door Library Functions					 door_server_create(3DOOR)

NAME
door_server_create - specify an alternative door server thread creation function SYNOPSIS
cc -mt [ flag ... ] file ... -ldoor [ library ... ] #include <door.h> void (*) () door_server_create(void (*create_proc)(door_info_t*)); DESCRIPTION
Normally, the doors library creates new door server threads in response to incoming concurrent door invocations automatically. There is no pre-defined upper limit on the number of server threads that the system creates in response to incoming invocations (1 server thread for each active door invocation). These threads are created with the default thread stack size and POSIX (see standards(5)) threads cancella- tion disabled. The created threads also have the THR_BOUND | THR_DETACHED attributes for Solaris threads and the PTHREAD_SCOPE_SYSTEM | PTHREAD_CREATE_DETACHED attributes for POSIX threads. The signal disposition, and scheduling class of the newly created thread are inherited from the calling thread (initially from the thread calling door_create(), and subsequently from the current active door server thread). The door_server_create() function allows control over the creation of server threads needed for door invocations. The procedure create_proc is called every time the available server thread pool is depleted. In the case of private server pools associated with a door (see the DOOR_PRIVATE attribute in door_create()), information on which pool is depleted is passed to the create function in the form of a door_info_t structure. The di_proc and di_data members of the door_info_t structure can be used as a door identifier associated with the depleted pool. The create_proc procedure may limit the number of server threads created and may also create server threads with appropri- ate attributes (stack size, thread-specific data, POSIX thread cancellation, signal mask, scheduling attributes, and so forth) for use with door invoca- tions. The specified server creation function should create user level threads using thr_create() with the THR_BOUND flag, or in the case of POSIX threads, pthread_create() with the PTHREAD_SCOPE_SYSTEM attribute. The server threads make themselves available for incoming door invocations on this process by issuing a door_return(NULL, 0, NULL, 0). In this case, the door_return() arguments are ignored. See door_return(3DOOR) and thr_create(3C). The server threads created by default are enabled for POSIX thread cancellations which may lead to unexpected thread terminations while holding resources (such as locks) if the client aborts the associated door_call(). See door_call(3DOOR). Unless the server code is truly interested in notifications of client aborts during a door invocation and is prepared to handle such notifications using cancellation handlers, POSIX thread cancellation should be disabled for server threads using pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, NULL). The create_proc procedure need not create any additional server threads if there is at least one server thread currently active in the process (perhaps handling another door invocation) or it may create as many as seen fit each time it is called. If there are no available server threads during an incoming door invocation, the associated door_call() blocks until a server thread becomes available. The cre- ate_proc procedure must be MT-Safe. RETURN VALUES
Upon successful completion, door_server_create() returns a pointer to the previous server creation function. This function has no failure mode (it cannot fail). EXAMPLES
Example 1: Creating door server threads. The following example creates door server threads with cancellation disabled and an 8k stack instead of the default stack size: #include <door.h> #include <pthread.h> #include <thread.h> void * my_thread(void *arg) { pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); door_return(NULL, 0, NULL, 0); } void my_create(door_info_t *dip) { thr_create(NULL, 8192, my_thread, NULL, THR_BOUND | THR_DETACHED, NULL); } main() { (void)door_server_create(my_create); ... } ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Architecture |all | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
door_bind(3DOOR), door_call(3DOOR), door_create(3DOOR), door_return(3DOOR), libdoor(3LIB), pthread_create(3C), pthread_setcancelstate(3C), thr_create(3C), attributes(5), cancellation(5), standards(5) SunOS 5.10 20 Aug 1997 door_server_create(3DOOR)
All times are GMT -4. The time now is 11:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy