Sponsored Content
Top Forums Programming Question on creation of Thread pool Post 302115580 by porter on Wednesday 25th of April 2007 05:31:49 PM
Old 04-25-2007
Quote:
Originally Posted by Radha
i am in a process of creating a multithread pool using
clone() system call in unix with c programming.
Are you sure? You are more likely using clone() on Linux which is not Unix.

I suggest instead of using Linux's clone() you use pthread_create, you will end up with a much more portable solution.
 

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
pool_get_binding(3POOL) 			 Pool Configuration Manipulation Library Functions			   pool_get_binding(3POOL)

NAME
pool_get_binding, pool_set_binding, pool_get_resource_binding - set and query process to resource pool bindings SYNOPSIS
cc [ flag... ] file... -lpool [ library... ] #include <pool.h> char *pool_get_binding(pid_t pid); int pool_set_binding(const char *pool, idtype_t idtype, id_t id); char *pool_get_resource_binding(const char *type, pid_t pid); DESCRIPTION
The pool_get_binding() function returns the name of the pool on the running system that contains the set of resources to which the given process is bound. If no such pool exists on the system or the search returns more than one pool (since the set of resources is referred to by more than one pool), NULL is returned and the pool error value is set to POE_INVALID_SEARCH. It is possible that one of the resources to which the given process is bound is not associated with a pool. This could occur if a processor set was created with one of the pset_() functions and the process was then bound to that set. It could also occur if the process was bound to a resource set not currently associated with a pool, since resources can exist that are not associated with a pool. The pool_set_binding() function binds the processes matching idtype and id to the resources associated with pool on the running system. This function requires the privilege required by the underlying resource types referenced by the pool; generally, this requirement is equivalent to requiring superuser privilege. The idtype parameter can be of the following types: P_PID The id parameter is a pid. P_TASKID The id parameter is a taskid. P_PROJID The id parameter is a project ID. All currently running processes belonging to the given project will be bound to the pool's resources. The pool_get_resource_binding() function returns the name of the resource of the supplied type to which the supplied process is bound. The application must explicity free the memory allocated for the return values for pool_get_binding() and pool_get_resource_binding(). RETURN VALUES
Upon successful completion, pool_get_binding() returns the name of the pool to which the process is bound. Otherwise it returns NULL and pool_error(3POOL) returns the pool-specific error value. Upon successful completion, pool_set_binding() returns PO_SUCCESS. Otherwise, it returns PO_FAIL and pool_error() returns the pool-specific error value. Upon successful completion, pool_get_resource_binding() returns the name of the resource of the specified type to which the process is bound. Otherwise it returns NULL and pool_error() returns the pool-specific error value. ERRORS
The pool_get_binding() function will fail if: POE_INVALID_CONF The configuration is invalid. POE_INVALID_SEARCH It is not possible to determine the binding for this target due to the overlapping nature of the pools configured for this system, or the pool could not be located. POE_SYSTEM A system error has occurred. Check the system error code for more details. The pool_set_binding() function will fail if: POE_INVALID_SEARCH The pool could not be found. POE_INVALID_CONF The configuration is invalid. POE_SYSTEM A system error has occurred. Check the system error code for more details. The pool_get_resource_binding() function will fail if: POE_INVALID_CONF The configuration is invalid. POE_INVALID_SEARCH The target is not bound to a resource of the specified type. POE_SYSTEM A system error has occurred. Check the system error code for more details. EXAMPLES
Example 1 Bind the current process to the pool named "target". #include <sys/types.h> #include <pool.h> #include <unistd.h> ... id_t pid = getpid(); ... if (pool_set_binding("target", P_PID, pid) == PO_FAIL) (void) fprintf(stderr, "pool binding failed (d)0 pool_error()); ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ |Interface Stability |Unstable | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
libpool(3LIB), pool_error(3POOL), attributes(5) SunOS 5.11 27 Mar 2007 pool_get_binding(3POOL)
All times are GMT -4. The time now is 01:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy