| 
 | 
 | 
 
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » "DoEvents" or "wxSafeYield" equivalent in Upp++ 
	
		
		
			| "DoEvents" or "wxSafeYield" equivalent in Upp++ [message #17844] | 
			Sun, 31 August 2008 02:09   | 
		 
		
			
				
				
				  | 
					
						  
						koldo
						 Messages: 3453 Registered: August 2008 
						
					 | 
					Senior Veteran  | 
					 | 
		 
		 
	 | 
 
	
		Hello all 
 
I would like to use some kind of "poor man" multithreading for long "for" loops. Like: 
for (int i = 0; i < MANY_LOOPS; ++i) {
  ThingsToDo();
  DoEvents();
}
 
where DoEvents() lets some kind of "cooperative multitasking" by: 
- disabling the user input to all program windows  
- asking the Upp++ main loop to handle the pending messages in the windowing system  
- re-enabling it again afterwards 
 
Disabling user input would avoid unwanted reentrance of code. 
 
In this moment this will be enough for me and much easier to handle than real multitasking with the gui. 
 
Best regards
		
		
  Best regards 
Iñaki
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 14:05:54 CET 2025 
 Total time taken to generate the page: 0.08949 seconds 
 |   
 |  
  |