thread difficulties

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gabitzu4224
    New Member
    • Jan 2008
    • 3

    thread difficulties

    ive posted some other question in the past few days but they dont seem to appear...anyway ive researched my problem a bit more and ive narrowed it down o one question:

    why do threads just exit even though the function i call using threads has raw_input() in it ?

    Note: this happens while program is running in DOS, in the interpreter the threads act like i expect them to do, but in DOS they just exit

    example:
    ------------------------------------------------------------------
    import thread

    def input():
    data = raw_input()
    return data

    thread.start_ne w(input,())

    ------------------------------------------------------------------

    this exits before i can input the data....why does this happen and how can i get passed it?
  • Subsciber123
    New Member
    • Nov 2006
    • 87

    #2
    First, use [ code=python ] [ /code ] (without the spaces) tags around your code. Second, there is no meaning to returning values from functions called in a new thread. Third, I have no idea why the thread is exiting. I don't know if raw_input() is thread safe on windows. It could very well be, but it might not.

    Comment

    Working...