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 » Community » Newbie corner » Simple thread example
Re: Simple thread example [message #29672 is a reply to message #29631] Sat, 06 November 2010 19:45 Go to previous messageGo to previous message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
I have the Java app ported to C++

It works great! A little faster and less CPU usage than Java and no problems with heap space.

It reads a file with lines like this:
34.212518,-119.192363,36.0,N10801,113

It interacts through a socket with NASA WWJ as 3D tracking on the Earth WGS84 ellipsoid rather than a round globe or a flat space.

The fourth comma delimited value is an ID.
With a file with more positions/IDs can track/draw paths for up to 50 on a single core (<50% CPU usage) updated each second.

I do have one glitch in the C++ code.
In the Exit() function:
    	in.Close();
    	Thread::ShutdownThreads();

plus saving a config file with settings.
That works OK.

But clicking the red x to close the app gives errors.
Sometimes:
Assertion failed in C:\upp\uppsrc\Core\String.cpp, line 38 rc->rfcount>0

or just closes with these error details":
Problem signature:
  Problem Event Name:	APPCRASH
  Application Name:	Replay.exe
  Application Version:	0.0.0.0
  Application Timestamp:	4cd51eb8
  Fault Module Name:	Replay.exe
  Fault Module Version:	0.0.0.0
  Fault Module Timestamp:	4cd51eb8
  Exception Code:	80000003
  Exception Offset:	0013ad26
  OS Version:	6.0.6002.2.2.0.768.3
  Locale ID:	1033
  Additional Information 1:	0245
  Additional Information 2:	6ea91fa736a6c7dd9ccfae9a5d57ed32
  Additional Information 3:	fa73
  Additional Information 4:	93d639f2a4427fa651c7717b5f37f438


In Java had a similar problem. After a considerable amount of searching and tinkering
				af.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
closes all processes/threads associated with the app, otherwise a bunch of javaw processes need to be closed with task manager.

I would rather not tinker with the Upp core code. Is there a way in Upp/C++ to close all open files and end all threads started by the app when clicking the red x to end?


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Upp (Help) documentation
Next Topic: Few questions
Goto Forum:
  


Current Time: Wed May 29 19:46:23 CEST 2024

Total time taken to generate the page: 0.00580 seconds