re-entrancy question

A

apocalypznow

I have a program that instantiates some objects and runs a main loop.
Before the main loop starts, I create a thread that listens to TCP
connections on a port. If any connections are made, and depending on
the data, I call methods on some of those objects.

I am worried that calling methods on objects from outside the main loop,
but that are also operated on in the main loop, could cause problems.

My questions:
1) is this safe?
2) what kind of problems could occur?
3) how do I safely handle this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,219
Messages
2,571,118
Members
47,731
Latest member
unutbu

Latest Threads

Top