|
-
Oct 8th, 2004, 08:17 AM
#1
Thread Starter
Lively Member
Re-entrancy
Greetings.
I will describe a scenario below, please tell me if you think it can cause re-entracy in the code or do other similar problems.
I am doing a server application, it uses a bunch of winsocks for connections.
Let's suppose that all the application is running in a single thread, and that lot of data is arriving to the sockets (LAN connection with lot of data being sent).
Every winsock has an instance of an object that is responsible of parsing the data that arrives.
in the DataArrival event, the AppendData method of the object is called and passed the new data, this method first appends the data to a variable and then checks if the Parser function is running (thru a flag).
If the Parser function is NOT running, the AppendData method sets up an API timer. In the API Timer's fire event, the Parser function is called and the isParserRunning flag is set to true.
Now, the parser parses all the incoming data, and calls the NewLine function on every new line found.
The new line function calls method from objects in a collection according to data it receives from the Parser function.
Now, some of the objects in the collection contain "DoEvents", can this cause any trouble, like cause re-entrancy? (note that the timer is an API timer, not a normal VB timer ... does it make an changes ?)
Thanks in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|