Solved

Multithreading inDelphi

Posted on 2000-02-18
8
177 Views
Last Modified: 2010-04-04
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
Comment
Question by:evansj
8 Comments
 
LVL 5

Expert Comment

by:TheNeil
Comment Utility
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
 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
Why not looking at the demo in delphi?

{$Delphi}\Demos\threads

Zif
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 200 total points
Comment Utility
0
 

Expert Comment

by:niknoxe
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 3

Expert Comment

by:bryan7
Comment Utility
listenning
0
 

Author Comment

by:evansj
Comment Utility
I'm also reissuing this question for TheNeil so he can get points also.
0
 
LVL 5

Expert Comment

by:TheNeil
Comment Utility
Thanks for the points - don't know if I deserve but you won't hear any complaints (well not from me).

The Neil
0
 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now