thread question

  • Thread starter Thread starter fniles
  • Start date Start date
F

fniles

I am using VS 2008.
I need to process message on accounts.
I would like to create thread for each account, and in each of the account
thread, I will do the process in order the message comes in.
For example:
Accounts 1, 2 and 3.
Accounts 1 has 2 messages, account 2 has 3 messages and account 3 has 3
messages.
I would like to create 3 thread: 1 for account 1, 1 for account 2, and 1 for
account 3.
In thread 1 for account 1, I want to process the 2 messages in order they
come in: message A, then B
In thread 2 for account 2, I want to process the 3 messages in order they
come in.: message A, then B, then C
In thread 3 for account 3, I want to process the 3 messages in order they
come in.: message A, then B, then C

Can I do the above ?

Thank you
 
Probably you can do that, but be aware that those processes don't go faster
because for that or you should have for every account a separated Internet
connectors (Providers not a mailboxes or something like that). Then there is
a change it will go faster.

So why do you want to do this?
 
So why do you want to do this?
Because in each account I have to process the messages in sequence,
currently I process everything in 1 thread.
So, I process accounts 1, 2 and 3 all in 1 thread.
But, this sometimes can be slow for example if account 1 has many messages,
account 3 has to wait for account 1 and 2 to finish, even though account 2
and 3 are independent of account 1.
Can you suggest a better way to do it faster ?

Thank you.
 
Yea,

Find out where it goes slow before you do work for nothing.

If the messages are arriving slow, then it makes no sense to process them
faster.

In other ways, it makes no sense to make a 10 lanes highway, while all cars
have to pass one toll gate first one by one.

Cor
 
Back
Top