Hi, it is no problem to use the pthread API to start threads. It is just up to you, what you do in your c++-Code. Tntnet does not care.
Tntnet itself uses the tread-classes from cxxtools, which are simple wrappers around the pthread API. One problem is, that there is no application startup hook (actually you may trick with the factory ctor but I don't recomended it). You may create a singleton class, which starts the thread when the first request arrives. Notification about stopping tntnet may be received in a dtor of a class in application scope. It may me an idea to implement some sort of application thread in tntnet, which is started when the application is loaded and stoppend when tntnet is stopped. But stopping a thread may be somewhat difficult, since the thread need to cooperate. Another idea is to create a timer, which is called in regular intervals. This timer may have also access to application and thread scope variables. Something like this is ecpp: <%timer interval="1000"> doSomeWorkHere(); </%timer> What do you think? Tommi ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Tntnet-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tntnet-general
