Re[4]: wxThread->Delete hangs, is there a work around?

wxWindows

    Next

  • 1. GUI refreshing
    Hi, I have a function in which a for loop which runs "infinitely". This stops the GUI from repainting or refreshing. How can I keep my GUI refreshed while in this loop. Thanks, Lloyd ______________________________________ Scanned and protected by Email scanner --------------------------------------------------------------------- To unsubscribe, e-mail: XXXX@XXXXX.COM For additional commands, e-mail: XXXX@XXXXX.COM
  • 2. wxUniversal that uses OpenGL ?
    I'm just wondering if there has been any consideration of having a wxUniversal back end that uses OpenGL as the underlying window/rendering system ? As well as being fairly portable (if you have OpenGL), the idea would be to make available the transparency, scaling and other 3D transformations to a themed widget set, as well as (perhaps) being the first step towards widgets that can mix controls more seamlessly into a 3D display/manipulation task, without necessarily running on a native 3D desktop. Graeme Gill. --------------------------------------------------------------------- To unsubscribe, e-mail: XXXX@XXXXX.COM For additional commands, e-mail: XXXX@XXXXX.COM
  • 3. wxToolbar button id can not greater than 65535?
    I add wxToolbar in my project, call 'AddTool(button_id...' to add the tool button, when my button greather than 65535(0xFFFF), the button event process can not work.

Re[4]: wxThread->Delete hangs, is there a work around?

Postby vadim » Fri, 02 Jul 2004 08:16:47 GMT



RF> Well, I tried it and it gave me less information than what I have
RF> provided before..   It exited with a first chance exception.  The spot
RF> which it exited was : 
RF> 
RF> return m_internal->WaitForTerminate(m_critsect, pRc, this);

 What is the value of m_internal? Has it been already deleted?

RF> Why does it need to Waitfortermination?

 I can't answer this otherwise than by telling you to read the code...

RF> One idea I had was to change a bool value inside the thread class.
RF> That way, in the worker thread loop, I would keep checking the bool
RF> value, and when it changed to true (for cancel) I could exit the
RF> thread.. 

 Well, this is exactly what TestDestroy() already does.

RF> Also, what does the term "This function can only be called from
RF> another thread context" mean ?

 It can't be called by the thread itself.

 Regards,
VZ


---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 


Re[4]: wxThread->Delete hangs, is there a work around?

Postby vadim » Fri, 02 Jul 2004 08:20:36 GMT



RF> The problem?    The documentation doesn't say that you can't delete
RF> detachable threads...   

 I would have thought that this quote from wxThread docs:

	... all detached threads must be created on the heap because the
	thread will call delete this; upon termination...

would be enough. It's obviously incorrect to delete the same object twice!

RF> Well, I tried this, in fact early on, but what I didn't know was that
RF> when you put the bool inside the thread class and then try to change
RF> it from the parent by doing something like thread->stopthread=true; ,
RF> it caused the exceptions I was seeing -- the thread doesn't stop, and
RF> GUI locks up)..

 Certainly not because of a simple (and thread unsafe, it should be
noticed) assignment. There must have been something else.

RF> It works when you put the bool value in the Parent class..  It seems
RF> the thread can access the parent and change its values, but the parent
RF> CAN'T change the threads variables.

 This is totally wrong.

 Regards,
VZ


---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 


Re: Re[4]: wxThread->Delete hangs, is there a work around?

Postby fox_no_spam-usenet001 » Fri, 02 Jul 2004 12:59:26 GMT






NO NO NO,  when I said delete, I mean wxThread::Delete(), not the heap
delete...


I found the problem though..  My bad on this, everything seems to be
working ok now..

I had a variable named "thread" in the function and that was same name
as the one in the class...  thus, it was a scope issue.. When I tried
wxThread::Delete(), it didn't have the proper address in it, thus the
error...  I didn't catch it because the same function that starts the
thread also stops it..  

My bad..

Thanks

Randall Fox



---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 


Similar Threads:

1.wxThread->Delete hangs, is there a work around?

wxWidgets 2.4.2
MSW 2000
MSVC 6


Checking the archives and all, I saw there is a problem with the
thread delete command..  I was wondering if there is a work around for
it?

For me, the thread delete is hanging.  If I don't call the delete and
let the detached thread finish normally, all is fine, but when I try
to prematurely stop it, the delete command hangs..

Is there a work around for my wx version?  I tried posting an event
before deleting the existing thread, but the delete invariably hangs.

I am calling delete from the dialog that launches the thread, it is
launched in response to a button press.  Another button press also
allows the user to terminate the thread early..

Any help is appreciated..

Randall Fox

---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 

2.Re[2]: wxThread->Delete hangs, is there a work around?

On Tue, 29 Jun 2004 13:02:01 -0700 Randall Fox < XXXX@XXXXX.COM > wrote:

RF> Tried 2.5.2, and no luck..   It doesn't hang anymore, but it won't
RF> delete either..  The thread keeps going as evident from the wxGauge,
RF> and the dialog pops a"unhandled exception" box...

 This means there is a problem somewhere and if you set your debugger to
break on all exceptions (instead of only on unhandled ones) you should be
able to find out where and what it is.

 Regards,
VZ


---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 

3.wxThread::Wait and wxThread::Delete on Windows

Hello,

i'm trying to "gently" terminate a worker thread near the end of the 
application.
unfortunately, Wait/Delete systematically revert to Kill when the end of app 
happened (because the quit message is in the pump) :(
it prevents proper end of any thread when ending the app...

Regards
Armel


4.wxThread::Delete hanging

On Wed, 04 Jun 2003 19:07:43 GMT Ben Redman < XXXX@XXXXX.COM > wrote:

BR> I'm using wxWindows 2.4.0, and I'm having a problem when shutting down my
BR> application. When I attempt to shut it down, the application hangs until it
BR> receives another event e.g. I click in the applications window. This doesn't
BR> always happen, and I believe, depends on timing.
BR> 
BR> I've tracked it down to within Thread.cpp, wxThread::Delete(ExitCode *pRc)
BR> 
BR> This calls:
BR>             result = ::MsgWaitForMultipleObjects
BR>                      (
BR>                        1,              // number of objects to wait for
BR>                        &hThread,       // the objects
BR>                        FALSE,          // don't wait for all objects
BR>                        INFINITE,       // no timeout
BR>                        QS_ALLINPUT |   // return as soon as there are any
BR> events
BR>                        QS_ALLPOSTMESSAGE
BR>                      );
BR> 
BR> to wait until there is an object. The problem comes later on, when there is
BR> a result of  WAIT_OBJECT_0 + 1
BR> 
BR>                     // new message arrived, process it
BR>                     if ( !wxTheApp->DoMessage() )
BR>                     {
BR>                         // WM_QUIT received: kill the thread
BR>                         Kill();
BR> 
BR>                         return wxTHREAD_KILLED;
BR>                     }
BR>                     break;
BR> 
BR> within DoMessage, there is a blocking call:
BR> 
BR>     BOOL rc = ::GetMessage(&s_currentMsg, (HWND) NULL, 0, 0);
BR> 
BR> is made. In the instances when the application is hanging, this is blocking.
BR> With a bit of experimentation, I've added in a check using ::PeekMessage
BR> just before the call to ::Getmessage, to make sure there is something there
BR> that ::GetMessage can get.

 I've added a very similar but slightly different workaround, could you
please try the current cvs HEAD and check if it fixes your problem?

 Thanks,
VZ


---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 

5.>>>>>>>>>>>>Index.dat

On my computer there is a file called index.dat which is 
uses by IE so when i try to delete it it says that you 
can't. I know that i can delete it if i go into DOS but 
if i do delete it what would happen?

Yhe reason i want to delete is that i read somewhere that 
i has all your browsing history in it. Could you also 
tell me what the file is used for. if that is not what it 
is used for.

6. work around hung welcome screen

7. >>>>>>>>>>>>>>>>>>>

8. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>



Return to wxWindows

 

Who is online

Users browsing this forum: No registered users and 58 guest