Search found 145 matches

by gtafan
Tue Dec 11, 2018 4:09 pm
Forum: Announcements and Discoveries
Topic: wxWidgets v3.1.2 release is out ;)
Replies: 4
Views: 455

Re: wxWidgets v3.1.2 release is out ;)

Technically only even minor version numbers indicate a "stable" version (2.6.x, 2.8.x, 3.0.x, 3.2.x etc) Therefore 3.1.2 is a "development" version. But "stable" only means that the API is stable, it doesn't mean that it crashes less. IMHO 3.1.2 is safe to use, even for production. OK, so stay with...
by gtafan
Tue Dec 11, 2018 1:59 pm
Forum: Announcements and Discoveries
Topic: wxWidgets v3.1.2 release is out ;)
Replies: 4
Views: 455

Re: wxWidgets v3.1.2 release is out ;)

But is it a stable version?
by gtafan
Tue Dec 11, 2018 1:31 pm
Forum: C++ Development
Topic: Full Working Example of a wxGrid
Replies: 15
Views: 2561

Re: Full Working Example of a wxGrid

That wiki stuff seems to be really interesting, specialy since it shows how useles some wxGrid functions are. I mean for example that SetColFormatFloat, it does nothing really usefull and since it is not posible to get and set float values to a cell of the grid it apears complete useless to me. Can ...
by gtafan
Mon Dec 03, 2018 2:58 pm
Forum: C++ Development
Topic: wxThread and OpengL
Replies: 7
Views: 306

Re: wxThread and OpengL

Hi, Accessing ANY GUI IN THE SECONDARY THREAD IS NOT SAFE AND WILL LEAD TO CRASJES!!!! It might work in one OS, or maybe 2 (if you are lucky), but generally in a cross-platform environment it is considered a VERY BAD PRACTICE!!! Thank you. What you mean by NOT SAFE? Not thread safe? Why should it b...
by gtafan
Wed Nov 28, 2018 2:56 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1814

Re: wxThread Kill()

doublemax wrote:You can probably achieve the same with wxSemaphore, but as wxCondition already has sample code that does exactly what you want, i'd go with that.
But wxCondition needs a mutex, that is not necesary for semaphor, but posibly I just understood everything wrong.
by gtafan
Tue Nov 27, 2018 2:49 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1814

Re: wxThread Kill()

If you want to get fancy, you can use wxCondition to wait for the thread to end. This will still block the execution of the main thread, but it won't be a busy loop that uses CPU. https://docs.wxwidgets.org/trunk/classwx_condition.html Thanks, will take a look at that wxCondition. What about wxSema...
by gtafan
Fri Nov 23, 2018 12:22 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1814

Re: wxThread Kill()

But that´s still buisy waiting. I mean it´s defenetly better then endles loop, but I am wondering why there is no good mechanism in C++ to manage something like that. I mean in Java something like that could be done very easy. Well, as DoubleMax already said: At some point the code is waiting, in t...
by gtafan
Thu Nov 22, 2018 3:21 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1814

Re: wxThread Kill()

Using an endless loop to wait for the end of thread and after that leaving it with breack is a really ugly solution in my opinion. I mean while(m_pThread); would be a bit better, but still a waste of resorces. I thought Delete waits for thread to call TestDestroy() and only after that the main appl...
by gtafan
Thu Nov 22, 2018 2:39 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1814

Re: wxThread Kill()

You can only Wait() for joined threads. Detached threads are "fire and forget" as they destroy themselves. You can: 1) just ignore it and terminate the application after calling Destroy() (not recommended) 2) wait a fixed amount of time (e.g. 1 second) after calling Destroy(). If the thread calls T...
by gtafan
Wed Nov 21, 2018 2:59 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1814

Re: wxThread Kill()

I am calling TestDestroy() and the thread terminates, but the main thread is not waiting for it to terminate.
by gtafan
Mon Nov 19, 2018 12:37 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1814

Re: wxThread Kill()

Can you explain in more detail what you want to achieve? Especially: While the background thread is working, can the user continue to use the application in every way? Since the background thread is working all the time the main thread exists, the user should still be able to use the application in...
by gtafan
Fri Nov 16, 2018 4:13 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1814

Re: wxThread Kill()

Looks like the timer is not a perfect solution. I tried it, but in some situations it seems to behave like unsynchronized thread.
by gtafan
Tue Nov 13, 2018 4:00 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1814

Re: wxThread Kill()

I am not fearing pointers, but I hate to use them because they can produce memory leaks sometimes and they (memleaks) are really hard to find out. I see your point and I hate memory leaks, too. In this case though, you are quite safe because you delete your pointer only once and only upon ending th...
by gtafan
Tue Nov 13, 2018 1:12 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1814

Re: wxThread Kill()

Posibly I misunderstood something, I need to wait for the thread only at the end the rest it should run in background parallel to the main thread. Yes, that is what I tried to tell you with the examples I provided for you. You have to wait for your joined thread right after you ran it! (and not at ...
by gtafan
Fri Nov 09, 2018 4:27 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1814

Re: wxThread Kill()

Hi, So all in all the reason for MT is to not block UI for the time calculation is done? How much time does it take to perform it? Thank you. I have done no performance tests, since it is not limited to some special PC. Also since results from background thread are not used by the main application ...