Timeout with FILE* handle

This is a discussion on Timeout with FILE* handle within the Linux Programming forums, part of the Platform Specific Boards category; Yeah (redhat 7.2), on linux a pthread is an implementation of a LinuxThread isn't it. The problem is intermittent, but ...

  1. #16
    Registered User
    Join Date
    Aug 2002
    Posts
    351
    Yeah (redhat 7.2), on linux a pthread is an implementation of a LinuxThread isn't it.

    The problem is intermittent, but I know how to reproduce now.

    I'll see if I can reproduce with the code you posted. I'll post the results.

    vVv, what's the effect of calling _exit before or directly after pthread_exit? I mean, pthread_exit just cleans up the thread resources, and according to my man page, _exit sends SIGCHLD signal to processes inherited by the init process etc.

  2. #17
    Registered User
    Join Date
    Aug 2002
    Posts
    351
    ok, just tested last posted script. same problem.

    I changed the code to:
    Code:
    char *script1 = "#!/bin/sh\n"
                                     "my_bash_script.sh\n"
                                     "printf \"hello world\"";
    after the code 'times out' and EXITS i get the following still in my process list (ps -auxf):
    Code:
    root      9822  0.0  0.3  2232 1012 pts/5    S    12:37   0:00 /bin/sh my_bash_script.sh
    The script is acually doing a snmpdf (disk space analysis using SNMP) on a remote windows box with a ropey snmp daemon.

    Now, is this a Linux issue? Is snmpdf doing something wierd?

    One hack is to kill the PID of my_bash_script.sh from the C daemon using pid files, but I want ot get to the root of the problem.

  3. #18
    Registered User
    Join Date
    Aug 2002
    Posts
    351
    Well, if it's not my code (i.e. the system) then I need to hack:

    1) Use pid file to explicitly kill the pid of my_bash_script.sh - i don't want to have to manage these really.

    2) Run a cron job that stop the daemon kills all processes owned by it and starts it again - i know!

    3) Use BSD.

    I can't think of anything else!

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting other processes class names
    By Hawkin in forum Windows Programming
    Replies: 3
    Last Post: 03-20-2008, 04:02 PM
  2. Replies: 8
    Last Post: 03-10-2008, 11:57 AM
  3. Direct3D problem
    By cboard_member in forum Game Programming
    Replies: 10
    Last Post: 04-09-2006, 03:36 AM
  4. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 05:23 AM
  5. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21