Re: Debugging a threads executable under Redhat Linux

From: callum.gibson_at_db.com
Date: Mon May 27 2002 - 01:07:00 BST

  • Next message: Bob Carragher: "Re: Debugging a threads executable under Redhat Linux"
    dancebob_at_mindspring.com writes:
    }Although this is probably not of general mailing-list
    }interest (and so you can email me directly if you want),
    
    Nah, this is a low-volume list and noone should reject a free education.
    
    }I was wondering if you could explain what "userland"
    }means.  Or is there a good web site where I can read up
    }on this?
    
    "userland" as opposed to "in the kernel". ie, the threads run as part of
    your user process. In this sort of implementation you have each thread
    run for a time slice and swap between them with a timer of some sort.
    
    In a kernel-supported implementation your time slices are managed by the
    kernel scheduler. That's the reason the Linux implementation uses separate
    processes (albeit a special kind of separate process) - it can use the
    kernel to schedule the running of the "threads". The Solaris method is
    more complicated but boils down to the fact that a non-multithreaded on
    Solaris is treated as a process with a single thread. ie. the threads
    are the things that can be scheduled, rather than whole processes (which
    may contain one or more threads). FreeBSD is moving towards a similar
    idea with the KSE project which should surface in the 5.x series.
    
    }> c) Debugger support could be provided (on platforms where it makes sense)
    }> by use of something like solaris' libthread_db (I think linux has this
    }> too). If someone added support for libthread_db on those platforms that
    }> have it, it would be a bonus. It would also isolate linux folk from
    }> changes in the implementation (in theory).
    }Under the 2.2.14 kernel, there is a libthread_db library.
    }It is version 1 (i.e. the library file is libthread_db.so.1).
    }Does that help?
    
    Sorry, I meant "added support to ups for libthread_db". Linux has no
    manpages I can find, however one could assume it's a Solaris work-alike
    (see td_init(3T)). From the (Solaris) manpage:
    
         The most commonly anticipated use for libthread_db  is  that
         the  controlling  process  will  be  a  debugger  for a mul-
         tithreaded program, hence the "db" in libthread_db.
    
    So some enterprising young programmer could provide support for Solaris
    and Linux platforms, at least.
    
    Callum Gibson                               callum.gibson_at_db.com
    Global Markets IT, Deutsche Bank, Australia       61 2 9258 1620
    ### The opinions in this message are mine and not Deutsche's ###
    


    This archive was generated by hypermail 2.1.4 : Mon May 27 2002 - 11:55:24 BST