Skip to content
Snippets Groups Projects
Commit 01a1be32 authored by tewk's avatar tewk
Browse files

Removed second pthread_create in nbio build

parent fc8e36a9
No related branches found
No related tags found
No related merge requests found
...@@ -36,21 +36,22 @@ ...@@ -36,21 +36,22 @@
******************************************************************/ ******************************************************************/
int forward_io ( task_start_t * task_start ) int forward_io ( task_start_t * task_start )
{ {
pthread_attr_t pthread_attr ; //pthread_attr_t pthread_attr ;
pthread_attr_init( & pthread_attr ) ; //pthread_attr_init( & pthread_attr ) ;
/* set detatch state */ /* set detatch state */
/*pthread_attr_setdetachstate ( & pthread_attr , PTHREAD_CREATE_DETACHED ) ;*/ /*pthread_attr_setdetachstate ( & pthread_attr , PTHREAD_CREATE_DETACHED ) ;*/
if ( pthread_create ( & task_start->io_pthread_id[STDIN_FILENO] , NULL , do_nbio , task_start ) ) //if ( pthread_create ( & task_start->io_pthread_id[STDIN_FILENO] , NULL , do_nbio , task_start ) )
{ //{
return SLURM_FAILURE ; // return SLURM_FAILURE ;
} //}
return SLURM_SUCCESS ; //return SLURM_SUCCESS ;
return do_nbio ( task_start ) ;
} }
int wait_on_io_threads ( task_start_t * task_start ) int wait_on_io_threads ( task_start_t * task_start )
{ {
pthread_join ( task_start->io_pthread_id[STDIN_FILENO] , NULL ) ; //pthread_join ( task_start->io_pthread_id[STDIN_FILENO] , NULL ) ;
info ( "%i: nbio exit" , task_start -> local_task_id ) ; info ( "%i: nbio exit" , task_start -> local_task_id ) ;
/* thread join on stderr or stdout signifies task termination we should kill the stdin thread */ /* thread join on stderr or stdout signifies task termination we should kill the stdin thread */
return SLURM_SUCCESS ; return SLURM_SUCCESS ;
......
...@@ -126,7 +126,6 @@ void * task_exec_thread ( void * arg ) ...@@ -126,7 +126,6 @@ void * task_exec_thread ( void * arg )
/* create pipes to read child stdin, stdout, sterr */ /* create pipes to read child stdin, stdout, sterr */
init_parent_pipes ( task_start->pipes ) ; init_parent_pipes ( task_start->pipes ) ;
forward_io ( arg ) ;
#define FORK_ERROR -1 #define FORK_ERROR -1
#define CHILD_PROCCESS 0 #define CHILD_PROCCESS 0
...@@ -205,6 +204,7 @@ void * task_exec_thread ( void * arg ) ...@@ -205,6 +204,7 @@ void * task_exec_thread ( void * arg )
/* ask me how I know :) */ /* ask me how I know :) */
/* think once, twice, 10^100000000 times before changeing the below */ /* think once, twice, 10^100000000 times before changeing the below */
/*1*/setup_parent_pipes ( task_start->pipes ) ; /*1*/setup_parent_pipes ( task_start->pipes ) ;
/*1.5*/forward_io ( arg ) ;
/*2*/waitpid ( cpid , & task_return_code , 0 ) ; /*2*/waitpid ( cpid , & task_return_code , 0 ) ;
/*3*/wait_on_io_threads ( task_start ) ; /*3*/wait_on_io_threads ( task_start ) ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment