[muscle] Server Design issue.

  • From: "David Svanberg" <ds@xxxxxxxxxxx>
  • To: "muscle mailing list" <muscle@xxxxxxxxxxxxx>
  • Date: Wed, 15 Oct 2003 16:22:50 +0200

I have a server design question.

I want my server to be part of another application, that is, the server
should not be a stand-alone application. In my application I want to do a
lot of tasks and might suddenly want to start a muscle server, do some other
things, and suddenly restart the muscle server etc.

Do I need to have the ServerProcessLoop running in a separate thread? (This
works but I don't know if it is the best solution). Is there any other nice
technique that can be used to achieve this?

I have a class CNbServer that inherits from muscle::Thread. It has a member
variable that points to a muscle::ReflectServer object. In the CNbServer's
InternalThreadEntry method I call PutAcceptFactory and starts
ServerProcessLoop. I get afraid of all these threads running around... Is
this approach bad or good? Is there something I have to keep in mind, such
as mutex protecting access to some data/methods?

I really appricate your comments.

Best Regards,
David Svanberg
Software Engineer  Poseidon Simulation AS
Naeringsparken, P.O.Box 89, N-8376 Leknes, Norway
Tel:+47 760 54 330  Fax:+47 760 82 006
E-mail:ds@xxxxxxxxxxx  www.poseidon.no

POSEIDON - your maritime training partner

Other related posts: