Implement Multi Threading in C & kill the remaining Threads when you come out of any

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saikumar44
    New Member
    • Nov 2014
    • 2

    Implement Multi Threading in C & kill the remaining Threads when you come out of any

    i dont have i dea about multithreading in c... please help me
  • donbock
    Recognized Expert Top Contributor
    • Mar 2008
    • 2427

    #2
    There are two issues: thread management (which is OS dependent); and writing thread-safe code.

    Thread-safe code. To begin with, try to use only automatic and dynamically-allocated variables - avoid static/global variables. The topic is quite a bit more complicated but this is a good first step.

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      What OS are you using?

      If it's Windows, get a copy of Windows via C/C++ and read the chapter on multi threading.

      Once you have done that, post again and I will provide some sample Windows code.

      Comment

      Working...