I'm getting closer and closer to having my application working in a threaded environment. I am however getting stumped on a few things.
1. For the main thread, are you creating it using AfxBeginThread or are you considering the hook into Anvil as being your main thread? The reason I'm asking this is because I was thinking of creating a thread after I hooked into Anvil so that I could control how many messages could be put on the stack. I'm not sure if this will work though.
2. After my worker thread decides that an order needs to be placed it posts a message to the main thread to place the order. Then I am trying to identify how I can notify the worker thread once a position has been obtained.
The way I used to do this is by processing the heartbeat message and everytime I received the heartbeat message I made a call to see if I had obtained a position yet. Do you know if there is any other way to be notified that the order has been filled and a position has been obtained?
Thanks for all the help!!
1. For the main thread, are you creating it using AfxBeginThread or are you considering the hook into Anvil as being your main thread? The reason I'm asking this is because I was thinking of creating a thread after I hooked into Anvil so that I could control how many messages could be put on the stack. I'm not sure if this will work though.
2. After my worker thread decides that an order needs to be placed it posts a message to the main thread to place the order. Then I am trying to identify how I can notify the worker thread once a position has been obtained.
The way I used to do this is by processing the heartbeat message and everytime I received the heartbeat message I made a call to see if I had obtained a position yet. Do you know if there is any other way to be notified that the order has been filled and a position has been obtained?
Thanks for all the help!!