Sponsored Content
Top Forums Programming Question on creation of Thread pool Post 302115601 by jim mcnamara on Wednesday 25th of April 2007 10:15:53 PM
Old 04-25-2007
signals may affect all of the threads in a process... and as noted above, clone doesn't really make a thread, pthread_create does. clone is used as a step in creating threads on the Linux platform, where threads are more akin processes.
 

9 More Discussions You Might Find Interesting

1. Solaris

Thread creation in c++

Hi all! Is there a function in c++ to create new threads.I have writen a class "Thread" in which I will be calling this thread function to creat threads. Also is there a function to synchronize threads .I know that we can create objects like semaphores and critical sections to synchronize in... (2 Replies)
Discussion started by: vijlak
2 Replies

2. Solaris

DiskSuite 4.2.1 Database creation question

I'm trying to figure out how to simply create a 500Gb ufs file system named /rec using DiskSuite 4.2.1 on a Solaris 8 platform via command line using two 250Gb partitions on two different disks. Does anyone know what the proper command string and options are to perform this task? Would I use the... (2 Replies)
Discussion started by: ruger14
2 Replies

3. Infrastructure Monitoring

zfs - migrate from pool to pool

Here are the details. cnjr-opennms>root$ zfs list NAME USED AVAIL REFER MOUNTPOINT openpool 20.6G 46.3G 35.5K /openpool openpool/ROOT 15.4G 46.3G 18K legacy openpool/ROOT/rds 15.4G 46.3G 15.3G / openpool/ROOT/rds/var 102M ... (3 Replies)
Discussion started by: pupp
3 Replies

4. Shell Programming and Scripting

thread creation

#include <stdio.h> #include <stdlib.h> #include <pthread.h> void *fork_thread(void *ptr ); main() { pthread_t thread1; char *message1 = "Thread 1"; int iret1; iret1 = pthread_create( &thread1, NULL, fork_thread, (void*) message1); exit(0); } Void *fork_thread(... (3 Replies)
Discussion started by: annapurna konga
3 Replies

5. Shell Programming and Scripting

thread creation

Void *fork_thread( void *ptr ) i am getting error in this line please help me out (1 Reply)
Discussion started by: annapurna konga
1 Replies

6. Solaris

ZFS pool question

I created a pool the other day. I created a 10 gig files just for a test, then deleted it. I proceeded to create a few files systems. But for some reason the pool shows 10% full, but the files systems are both at 1%? Both files systems share the same pool. When I ls -al the pool I just... (6 Replies)
Discussion started by: mrlayance
6 Replies

7. Solaris

need some help in resource pool creation

i have server carry more than 50 zone i want to create 2 resource pool assign 40 zone to resource pool number 1 assign 10 zone to resource pool number 2 how can i do that (1 Reply)
Discussion started by: coxmanchester
1 Replies

8. UNIX for Dummies Questions & Answers

thread pool problem

hello everyone. I want to implement a thread pool, with 10 threads most. Inside main,I call a function (lets say it foo) wich creates (if it is needed) or uses an existing thread from the pool and sends it to do a job.My problem is that I dont know how to pass the argument from the main to the... (2 Replies)
Discussion started by: garag11
2 Replies

9. UNIX for Dummies Questions & Answers

Question about lvm file creation

Hi, I have below code for disk creation disk_list=$(ls /dev/sd) for disk in $disk_list do pvcreate $i done So what my understanding is first it is checking the disk under /dev sdb,sdc,sdd,...sdz whether 25 disk are existing if not then its creating the 25 physical volume. I... (4 Replies)
Discussion started by: stew
4 Replies
pthread_create(3T)														pthread_create(3T)

NAME
pthread_create() - create a new thread of execution. SYNOPSIS
PARAMETERS
thread Pointer to the location where the created thread's ID is to be returned. attr Pointer to the thread attributes object describing the characteristics of the created thread. If the value is NULL, default attributes will be used. start_routine Function to be executed by the newly created thread. arg Parameter to be passed to the created thread's start_routine. DESCRIPTION
The function is used to create a new independent thread within the calling process. The thread will be created according to the attributes specified by attr. If attr is NULL, the default attributes will be used. The values of the attributes in attr describe the characteris- tics of the to-be-created thread in detail. Refer to the function for a list of the default attribute values. A single attributes object can be used in multiple calls to the function When a thread is created with an attributes object, the attributes are, in effect, copied into the created thread. Consequently, any change to the attributes object will not affect any previously created threads. Once all threads needing a specific attributes object have been created, the attributes object is no longer needed and may be destroyed. When the new thread is created, it will execute which has only one parameter, arg. If returns, an implicit call to is made. The return value of is used as the thread's exit status. The created thread's scheduling policy and priority, contention scope, detach state, stack size, and stack address are initialized accord- ing to their respective attributes in attr. The thread's signal mask is inherited from the creating thread. The thread's set of pending signals is cleared. Refer to pthread_exit(3T), pthread_detach(3T), and pthread_join(3T) for more information on thread termination and synchronizing with ter- minated threads. On success, the ID of the created thread is returned in thread. If fails, a thread is not created and the contents of thread are unde- fined. Thread IDs are guaranteed to be unique only within a process. NOTE: If the main thread returns from an implicit call to is made. The return value of is used as the process' exit status. The main thread can terminate without causing the process to terminate by calling Notes It is unspecified whether joinable threads that have exited but haven't been joined count against the limit. RETURN VALUE
Upon successful completion, returns zero. Otherwise, an error number is returned to indicate the error (the variable is not set). ERRORS
If any of the following occur, the function returns the corresponding error number: attr in an invalid thread attributes object. The value specified by thread is invalid. The necessary resources to create another thread are not available, or the number of threads in the calling process already equals The scheduling policy or scheduling attributes specified in attr are invalid. The caller does not have the appropriate privileges to create a thread with the scheduling policy and parameters specified in attr. AUTHOR
was derived from the IEEE POSIX P1003.1c standard. SEE ALSO
pthread_exit(3T), pthread_join(3T), fork(2). STANDARDS CONFORMANCE
Pthread Library pthread_create(3T)
All times are GMT -4. The time now is 10:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy