• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 187
  • Last Modified:

Multithreading inDelphi

How would you create threads say for scanning for a keypress and something else. I am working on a SCSI app and need to be able to test and interrupt the test at any time. The SRB_ABORT and SRB_EXEC need to run simultaneously. In other words, start reading a disk, then if I choose, press ESC and stop (SRB_ABORT). Right now, if I start a process (Reads, for example) the process locks me out until it completes, so I can not abort. Code snippets please.
0
evansj
Asked:
evansj
1 Solution
 
TheNeilCommented:
Try adding Application.ProcessMessages to your code at regular intervals (or in a loop if that's what you're using). You can then process key presses, set flags, and drop out if you need to. Far simpler than messing around with threads

The Neil
0
 
ZifNabCommented:
Why not looking at the demo in delphi?

{$Delphi}\Demos\threads

Zif
0
 
ZifNabCommented:
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
niknoxeCommented:
If this hadn't helped you, let me know. Application.ProcessMessages brings you on the right way, but there is a lot more to get them responding!
0
 
bryan7Commented:
listenning
0
 
evansjAuthor Commented:
I'm also reissuing this question for TheNeil so he can get points also.
0
 
TheNeilCommented:
Thanks for the points - don't know if I deserve but you won't hear any complaints (well not from me).

The Neil
0
 
ZifNabCommented:
Thanks for the points - I only hope you have found what you need, because otherwise this was a waste of points. zif.
0

Featured Post

Industry Leaders: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now