This is the mail archive of the
cygwin-xfree
mailing list for the Cygwin XFree86 project.
Fwd: strange behavior with threads...
- From: jean-luc malet <jeanluc dot malet at gmail dot com>
- To: cygwin-xfree at cygwin dot com
- Date: Wed, 29 Jul 2009 18:58:33 +0200
- Subject: Fwd: strange behavior with threads...
- References: <1de9d39c0907230650t3ae02e2agc540e9ef8fe4ca34@mail.gmail.com> <20090723141137.GA18621@calimero.vinschen.de> <1de9d39c0907240212w4d2809d2lc6904100f7a8c446@mail.gmail.com>
- Reply-to: cygwin-xfree at cygwin dot com
Hi!
can someone help me regarding this issue?
I have a multithreaded application (one thread for the GUI and one
thread for background processing [which only sleep at this time]) and
I'm getting connection errors only on cygwin/X (tested on linux and
linux in vm, 2 different linux distribution)
normally all X operation shall be protected with mutexes
any idea?
thanks
JLM
---------- Forwarded message ----------
From: jean-luc malet <jeanluc.malet@gmail.com>
Date: Fri, Jul 24, 2009 at 11:12 AM
Subject: Re: strange behavior with threads...
To: cygwin@cygwin.com
On Thu, Jul 23, 2009 at 4:11 PM, Corinna
Vinschen<corinna-cygwin@cygwin.com> wrote:
> On Jul 23 15:50, jean-luc malet wrote:
>> Hi!
>> I've the following code :
>> void _Window::Start(void* arg)
>> {
>> Â Â Â Â ThreadArgs args;
>> Â Â Â Â args.TheWindow=this;
>> Â Â Â Â args.args=arg;
>> Â Â Â Â int err = pthread_create(&main_thread,NULL,_Start, (void*)&args);
>> Â Â Â Â if (err)
>> Â Â Â Â {
>> Â Â Â Â Â Â Â Â throw new ÂException(err, "window thread creation error");
>> Â Â Â Â }
>> }
>> void* _Window::_Start(void* arg)
>> {
>> Â Â Â Â ThreadArgs* args = (ThreadArgs*) arg;
>> Â Â Â Â pthread_exit((void*)args->TheWindow->start_routine(args->args));
>> }
>>
>> _Window::_Start is static
>>
>> for some reason that I can't determine it happens that args in
>> _Window::_Start have strange value (args->TheWindow don't contain a
>> valid pointer, ie a pointer on a _Window object)
>
> Maybe you shouldn't let the arg to the thread point to a local
> stack-based variable in the other method which, as you code implies,
> returns after having started the thread...
>
>
> Corinna
>
> --
> Corinna Vinschen         ÂPlease, send mails regarding Cygwin to
> Cygwin Project Co-Leader     Âcygwin AT cygwin DOT com
> Red Hat
>
> --
> Problem reports: Â Â Â http://cygwin.com/problems.html
> FAQ: Â Â Â Â Â Â Â Â Â http://cygwin.com/faq/
> Documentation: Â Â Â Â http://cygwin.com/docs.html
> Unsubscribe info: Â Â Âhttp://cygwin.com/ml/#unsubscribe-simple
>
>
Yes, sorry for such lame question :( I should have seen this issue
the code has been modified and has been tested under linux and is now
working as expected under linux, thanks
however I have a X server connection issue
freeglut (./tests/GENERATED/GlutWindowTest): Unable to create direct
context rendering for window ' '
This may hurt performance.
XIO: Âfatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
  Âafter 34 requests (32 known processed) with 5 events remaining.
think I will have to post on Cygwin/X ML
thanks for help
JLM
--
KISS! (Keep It Simple, Stupid!)
(garde le simple, imbÃcile!)
"mais qu'est-ce que tu m'as pondu comme usine à gaz? fait des choses
simples et qui marchent, espÃce d'imbÃcile!"
-----------------------------
"Si vous pensez que vous Ãtes trop petit pour changer quoique ce soit,
essayez donc de dormir avec un moustique dans votre chambre." Betty
Reese
http://www.grainesdechangement.com/citations.htm
--
KISS! (Keep It Simple, Stupid!)
(garde le simple, imbÃcile!)
"mais qu'est-ce que tu m'as pondu comme usine à gaz? fait des choses
simples et qui marchent, espÃce d'imbÃcile!"
-----------------------------
"Si vous pensez que vous Ãtes trop petit pour changer quoique ce soit,
essayez donc de dormir avec un moustique dans votre chambre." Betty
Reese
http://www.grainesdechangement.com/citations.htm
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ: http://x.cygwin.com/docs/faq/