Czy
August 2nd, 2007, 05:49 AM
Hello,
I've been stumped on this problem at work for a week. It is my first exposure to multithreaded C++ programming, and I am completely frustrated at how difficult it is to do something so simple.
My task is to write a command-line test app for an API i have written (on a linux platform, RH7). The library beneath the API is a public communications library for VoIP SIP (Sofia Sip). The API spawns the communications stack in a posix thread, while the test app should read console commands and interact with the network events.
The main thread uses a GLib main loop which currently simply uses g_print() (which is like printf in GLib) to continually print a message.
The problem is that within the communications library there are a number of console outputs, and once this thread has been spawned, the subsequent printfs in the main thread will not show.
Note that this problem also exists if I don't use GLib, ie. in an infinite while loop etc.
I'm not sure what other information I can provide, so please ask! Any help would be greatly appreciated!
Thanks in advance,
Dan
I've been stumped on this problem at work for a week. It is my first exposure to multithreaded C++ programming, and I am completely frustrated at how difficult it is to do something so simple.
My task is to write a command-line test app for an API i have written (on a linux platform, RH7). The library beneath the API is a public communications library for VoIP SIP (Sofia Sip). The API spawns the communications stack in a posix thread, while the test app should read console commands and interact with the network events.
The main thread uses a GLib main loop which currently simply uses g_print() (which is like printf in GLib) to continually print a message.
The problem is that within the communications library there are a number of console outputs, and once this thread has been spawned, the subsequent printfs in the main thread will not show.
Note that this problem also exists if I don't use GLib, ie. in an infinite while loop etc.
I'm not sure what other information I can provide, so please ask! Any help would be greatly appreciated!
Thanks in advance,
Dan