Thread: issue about multitheading

  1. #1
    a newbie :p
    Join Date
    Aug 2008
    Location
    Zurich, Switzerland, Switzerland
    Posts
    91

    issue about multitheading

    dear all,

    are there any possibilities that one thread crash without crashing the whole program. In my opinion this is not possible as multiple threads are still sharing same resources. am i right here?

    if it is possible what kind of error/fault it will be?

    thanks

  2. #2
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    Well, considering threading is not part of the C standard, this really depends on your OS and thread library. It also depends on what you mean by "thread crash". I'm running CentOS 5.6 with the pthread library, and a seg fault in one thread took down the whole process. A small buffer overflow that causes a problem in one thread may or may not cause problems in another thread or the process as a whole. The error type for the program will probably be same as the error type for the thread, but your best bet is to write a small test program to produce the error you're concerned with in a single thread, and see how it affects the other threads and the process as a whole.

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    412
    Simply put; Any error that will terminate a singlethreaded application will do the same for a multithreaded one.
    By the way, if you're worried about crashes your OS might have some form of exception handling you can use. I know windows does and I'm guessing linux does to.
    Depending on the reasons for the error it might not be safe to just ignore it and continue, but it will at least let you exit with an error message explaining that something went wrong instead of just crashing the app.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. bandwidth issue / network issue with wireless device communication
    By vlrk in forum Networking/Device Communication
    Replies: 0
    Last Post: 07-05-2010, 11:52 PM
  2. new issue
    By hiddenprophecy in forum C Programming
    Replies: 3
    Last Post: 04-15-2009, 05:59 PM
  3. dll issue
    By axr0284 in forum C++ Programming
    Replies: 1
    Last Post: 03-23-2006, 08:37 AM
  4. pop up issue
    By RoD in forum Tech Board
    Replies: 6
    Last Post: 07-09-2003, 05:46 PM
  5. my first issue of GDM
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 09-12-2002, 04:02 PM

Tags for this Thread