Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » CoWork and shared memory
Re: CoWork and shared memory [message #35530 is a reply to message #35528] Sun, 26 February 2012 09:56 Go to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
peek wrote on Sat, 25 February 2012 14:05

Hello Mirek

So this way have Cowork processes to end fast because they work in any way in the same thread that main program?

I mean, to do:
App::~App() {
	finish = true;
	...

// and in Cowork function
if (finish)
	return;

is useless as destructor is not accessible until Cowork variable is destructed and that is is done when all Cowork calls have ended.



No, this still works - CoWork has no clue what the processing is and this one simply makes the processing "nop" and it ends quickly. The loop would still go through all iterations, thread will still preform them, but each iteration job will end immediately...

Quote:


A question: If the Cowork jobs lasts time a solution could be to run Cowork in a separate thread?



Well, not really, if you want a clean exit from the app...

The problematic thing is that for clean exit, you need cannot use any form on thread abortion - it has to exit through its normal exit point; otherwise it would result in resource leaks.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Point implicit conversions
Next Topic: put32 for double precision values..
Goto Forum:
  


Current Time: Mon May 13 18:26:18 CEST 2024

Total time taken to generate the page: 0.02595 seconds