Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

suspending and resuming a thread?

Status
Not open for further replies.

cyprus106

Programmer
Apr 30, 2001
654
I've got somewhat of an awkward problem that I've never come across before. I created a search utility to go through a grid and highlight the item that the user wants to find. The code works great, but once the first cell is highlighted, I have the thread Suspend() until the user clicks the "Find Next" button, at which point in time I call Resume() on the thread and let it find the next cell with the matching criteria. Unfortunately, I call resume and nothing happens. I noticed in the minimal documentation that you hvae to call resume as many times as you called suspend, but i only suspended once, but calling resume still does nothing? Can anyone help? Thanks!

Cyprus
 
would not that be an unnecessary overhead incurred
upon the system to have a thread going whether it
is suspended or not.

the "findtext ()" method example merely positions
the start of the text at the selected text and uses
this as the starting point for the search. you could
perhaps use a point structure to save the starting
position of the search. I am sure that the use of
a thread suspension and resume function will not speed
the search process significantly. after all, how soon
can the human finger react after the previous search.

and you have the potential for a thread being suspended
in the background that will never be used again. or do
we overengineer the project to add timers, atificial
inteligence, and a mass of cutesy dodads.

but I am sure you have a ligit reason that I cannot
foresee. in which case, nevermind.

tomcruz.net

 
Well, in the grid I'm using I had to create my own search functions, as finding a field in the manner in which was necessary required more detailed searches, among other thing. And the grid is for databases, but it isn't a datagrid (long story), and often we're dealing with very large quantities of data, sometimes into hundreds of thousands of records, plus. So a thread is necessary so the program doesn't lag down. As for the suspend and resume, I already am using point structs now. It was easier that way anyways. I still don't know why the thread wouldn't resume though.

Cyprus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top