mirror of
https://github.com/samba-team/samba.git
synced 2025-11-15 16:23:49 +03:00
Remaining changes to implement the prefork process model
To use, run 'smbd -M prefork' By default, only the smb service is preforked. 4 children are created, and all listen for new connections. The Linux Kernel 'wake one' behaviour should ensure that only one is given the oportunity to accept. We need to look into the ideal number of worker children, as well as load balancing behaviours. To change, set: prefork children : smb = 6 valid service names (smb in this example) match those in 'server services'. Andrew Bartlett and David Disseldorp
This commit is contained in:
@@ -148,6 +148,7 @@ static void *thread_task_fn(void *thread_parm)
|
||||
*/
|
||||
static void thread_new_task(struct event_context *ev,
|
||||
struct loadparm_context *lp_ctx,
|
||||
const char *service_name,
|
||||
void (*new_task)(struct event_context *,
|
||||
struct loadparm_context *,
|
||||
uint32_t , void *),
|
||||
@@ -178,10 +179,10 @@ static void thread_new_task(struct event_context *ev,
|
||||
rc = pthread_create(&thread_id, &thread_attr, thread_task_fn, state);
|
||||
pthread_attr_destroy(&thread_attr);
|
||||
if (rc == 0) {
|
||||
DEBUG(4,("thread_new_task: created thread_id=%lu\n",
|
||||
(unsigned long int)thread_id));
|
||||
DEBUG(4,("thread_new_task: created %s thread_id=%lu\n",
|
||||
service_name, (unsigned long int)thread_id));
|
||||
} else {
|
||||
DEBUG(0,("thread_new_task: thread create failed rc=%d\n", rc));
|
||||
DEBUG(0,("thread_new_task: thread create for %s failed rc=%d\n", service_name, rc));
|
||||
talloc_free(ev2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user