troubleshooting Question

Delphi: Separate Thread

Avatar of EricTaylor
EricTaylor asked on
ProgrammingDelphi
14 Comments1 Solution1200 ViewsLast Modified:
Our software, along with many other business-related actions, retrieves email which it summarizes key elements of in a client data set that the user can interact with in a variety of ways. A shortfall is that the user must still hit a "retrieve mail" button to get the mail since we don't want the main application thread stopped for a few seconds every minute checking to see if there is new mail and then updating the cds if there is any.

This sounds to me like a good candidate for putting the email retrieval in a separate thread, but I've never dealt with threads before, so I'm not sure where to begin or what the pitfalls are. I'd be happy for any foundational guidance on what to do/avoid in setting up the thread correctly, but in particular, would like to know how one handles potential conflicts between what the two threads are doing. e.g., what happens if the email retrieval thread is adding new messages to the cds at the same point that the user is double-clicking some other message in the data grid that is linked to the same cds? Thanks in advance for any help.
ASKER CERTIFIED SOLUTION
Geert G
Oracle dba
Join our community to see this answer!
Unlock 1 Answer and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros