Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

.Net void multi-threading

Posted on 2016-08-10
6
Medium Priority
?
57 Views
Last Modified: 2016-08-10
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()
0
Comment
Question by:lrbrister
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 2000 total points
ID: 41750443
you can wrap your code in a task and create 5 of them. Check http://emoreau.com/Entries/Articles/2013/10/SystemThreadingTask-class.aspx

but are you sure your provider will allow you to send 50,000 emails at the same time?
0
 
LVL 10

Expert Comment

by:Paweł
ID: 41750456
a task scheduler? what version of .net are you using?
0
 

Author Comment

by:lrbrister
ID: 41750466
Eric,
  50,000 at the same time in a "timeframe"

Pawel
.Net 4.5
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 41750481
you can try to wrap your code in task as shown by my article and launch your tasks
0
 

Author Closing Comment

by:lrbrister
ID: 41750482
Very nice
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 41750484
or just launch your job from the task scheduler 5 times with a parameter to process a different set of records in each instance
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question