M
Michael Mossey
Hello,
I have a simple application that needs one thread to manage networking
in addition to the main "thread" that does the main job. It's not
working right. I know hardly anything about threads, so I was hoping
someone could point me in the right direction to research this.
Basically, I have a program that does some computational work, and
also conveys its status to a monitor program elsewhere on the network
via sockets. I wanted to use a thread to manage the networking so that
the main program can run without regard to networking (i.e. they would
be asynchronous). So the network thread loops and calls select.
My problem is that in some cases, the network thread appears to stop,
while the main thread is doing a long computation.
I'm hoping someone can give me a general idea what to read about. For
example, under what conditions does a thread stop running? Can other
threads "take priority"? Are there certain operations that block other
threads (such as disk access)?
Thanks,
Mike
I have a simple application that needs one thread to manage networking
in addition to the main "thread" that does the main job. It's not
working right. I know hardly anything about threads, so I was hoping
someone could point me in the right direction to research this.
Basically, I have a program that does some computational work, and
also conveys its status to a monitor program elsewhere on the network
via sockets. I wanted to use a thread to manage the networking so that
the main program can run without regard to networking (i.e. they would
be asynchronous). So the network thread loops and calls select.
My problem is that in some cases, the network thread appears to stop,
while the main thread is doing a long computation.
I'm hoping someone can give me a general idea what to read about. For
example, under what conditions does a thread stop running? Can other
threads "take priority"? Are there certain operations that block other
threads (such as disk access)?
Thanks,
Mike