Link to home
Start Free TrialLog in
Avatar of Larry Brister
Larry BristerFlag for United States of America

asked on

.Net void multi-threading

I have a winforms app I inherited

In effect it opens with a task scheduler
Runs a sub (void) and closes

The SendMail void effectively sends 10,000 emails from a list it gets in SQL Server and send on to a providers smtp

That Provider allows 10,000 in a send....
But there can be multiple sends going on at the same time.

Is there a way to run the SendMail void in 5 separate "threads" so that 50k are being sent?

        SendMail(IsLive)
        Me.Close()
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
a task scheduler? what version of .net are you using?
Avatar of Larry Brister

ASKER

Eric,
  50,000 at the same time in a "timeframe"

Pawel
.Net 4.5
you can try to wrap your code in task as shown by my article and launch your tasks
Very nice
or just launch your job from the task scheduler 5 times with a parameter to process a different set of records in each instance