Re: Xlib : sequence lost (0x1718e > 0x71a0) in reply to 0x0!

2006-02-06 Thread niranjan
Hi
  to all
I have made separate  display connection to Xserver for each thread
   but this is working fine sometimes not always .sometime it fail
   when i  invoke the dialog .
   can anybody help me to resolve this issues .
Thanks



Each call to XOpenDisplay opens a new communication socket to
> the X-server.  Commands sent through this socket need to be serialized.
> If you have two threads trying to send data at the same time through
> the same socket they will corrupt each other's data.  XInitThreads
> enables a lock around the Xlib code that accesses the socket so
> that only one thread can send data through the socket at a time.
> This generally works fine except that if you pause one thread while
> it is in Xlib and has already taken the lock, it will prevent any other
> thread from entering Xlib and taking the lock.  Separate display
> connections for each thread are the solution to that.
>
>   Mark.
>
>
> On Wed, 1 Feb 2006 [EMAIL PROTECTED] wrote:
>
>> Hi
>>   u have given a good suggestion but I dont understand if the
>> pausing thread block any other thread trying to use the
>>Xlib with the same display connection then why it is working
>> fine sometimes .
>> Thanks
>>
>>  Separate threads either need to use separate display
>> > connections or you need to enable thread mutexes for a shared
>> > connection (XInitThreads will enable Xlib's internal mutexes).
>> > Note still, that pausing a thread while it's in Xlib can block
>> > any other threads also trying to use Xlib with the same display
>> > connection.  You'd want to use separate display connections
>> > for that.
>> >
>> >Mark.
>> >
>> > On Tue, 31 Jan 2006 [EMAIL PROTECTED] wrote:
>> >
>> >>  Hi to all
>> >>
>> >>
>> >> Iam building an kde Application When  I pause the current pthread and
>> >>   invoke an dialog in another thread the following error is
>> coming .
>> >>
>> >> Xlib : unexpected async reply
>> >> Xlib :sequence lost (0x1718e > 0x71a0) in reply to 0x0!
>> >> X Error : BadImplementation (server does not implement opertaion) 17
>> >> Major opcode : 20
>> >> MInor opcode : 0
>> >> Resource id  : 0x759d1
>> >> The error is coming randomly , not always .
>> >>   Can any will help how to come out of this error .
>> >>
>> >>
>> >>  Thanks
>> >> ___
>> >> Devel mailing list
>> >> Devel@XFree86.Org
>> >> http://XFree86.Org/mailman/listinfo/devel
>> >>
>> > ___
>> > Devel mailing list
>> > Devel@XFree86.Org
>> > http://XFree86.Org/mailman/listinfo/devel
>> >
>>
>> ___
>> Devel mailing list
>> Devel@XFree86.Org
>> http://XFree86.Org/mailman/listinfo/devel
>>
> ___
> Devel mailing list
> Devel@XFree86.Org
> http://XFree86.Org/mailman/listinfo/devel
>

___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Xlib : sequence lost (0x1718e > 0x71a0) in reply to 0x0!

2006-02-03 Thread Mark Vojkovich
   Each call to XOpenDisplay opens a new communication socket to
the X-server.  Commands sent through this socket need to be serialized.
If you have two threads trying to send data at the same time through
the same socket they will corrupt each other's data.  XInitThreads
enables a lock around the Xlib code that accesses the socket so
that only one thread can send data through the socket at a time.
This generally works fine except that if you pause one thread while
it is in Xlib and has already taken the lock, it will prevent any other
thread from entering Xlib and taking the lock.  Separate display
connections for each thread are the solution to that.

Mark.


On Wed, 1 Feb 2006 [EMAIL PROTECTED] wrote:

> Hi
>   u have given a good suggestion but I dont understand if the
> pausing thread block any other thread trying to use the
>Xlib with the same display connection then why it is working
> fine sometimes .
> Thanks
>
>  Separate threads either need to use separate display
> > connections or you need to enable thread mutexes for a shared
> > connection (XInitThreads will enable Xlib's internal mutexes).
> > Note still, that pausing a thread while it's in Xlib can block
> > any other threads also trying to use Xlib with the same display
> > connection.  You'd want to use separate display connections
> > for that.
> >
> > Mark.
> >
> > On Tue, 31 Jan 2006 [EMAIL PROTECTED] wrote:
> >
> >>  Hi to all
> >>
> >>
> >> Iam building an kde Application When  I pause the current pthread and
> >>   invoke an dialog in another thread the following error is coming .
> >>
> >> Xlib : unexpected async reply
> >> Xlib :sequence lost (0x1718e > 0x71a0) in reply to 0x0!
> >> X Error : BadImplementation (server does not implement opertaion) 17
> >> Major opcode : 20
> >> MInor opcode : 0
> >> Resource id  : 0x759d1
> >> The error is coming randomly , not always .
> >>   Can any will help how to come out of this error .
> >>
> >>
> >>  Thanks
> >> ___
> >> Devel mailing list
> >> Devel@XFree86.Org
> >> http://XFree86.Org/mailman/listinfo/devel
> >>
> > ___
> > Devel mailing list
> > Devel@XFree86.Org
> > http://XFree86.Org/mailman/listinfo/devel
> >
>
> ___
> Devel mailing list
> Devel@XFree86.Org
> http://XFree86.Org/mailman/listinfo/devel
>
___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Xlib : sequence lost (0x1718e > 0x71a0) in reply to 0x0!

2006-02-03 Thread niranjan
Hi
   Thanks for quick reply. I have did according to ur suggestion
call to XOpenDisplay for the new thread .
  But again it is working fine sometime . This is code, that I have
   did .


 *dpause (void *arg)
{
  display = XOpenDisplay ( 0 );
 pausem *paused_dialog = new pausem (0,"dpause");//here fails
  paused_dialog->show();
}

pause()
{
int rc =  pthread_create( &thread5, &attr, dpause, NULL );
rc=  pthread_join(thread5 ,&thr_retval ) ;
 while (pause_rec == 0 )
 {

   sleep(1);
  }
 if(pause_rec==1) {
  XCloseDisplay (display);
   pthread_exit(&thread5 ) ;
  }

}
 plz give some suggestion to solve this problem .
Thanks

>> What do you mean by separate display  connections" ?
>> The case is this :
>>
>>I mean a display connection returned by XOpenDisplay.
>>
>>
>
> Right.  I think what Carsten is saying is, if you might need to pause a
> thread in the middle of Xlib, then that thread needs to make its own
> call to XOpenDisplay, so that it has its own connection, separate from
> the rest of the application.
>
> --
> Tim Roberts, [EMAIL PROTECTED]
> Providenza & Boekelheide, Inc.
>
> ___
> Devel mailing list
> Devel@XFree86.Org
> http://XFree86.Org/mailman/listinfo/devel
>

___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Xlib : sequence lost (0x1718e > 0x71a0) in reply to 0x0!

2006-02-02 Thread Tim Roberts
[EMAIL PROTECTED] wrote:

> What do you mean by separate display  connections" ?
> The case is this :
>
>I mean a display connection returned by XOpenDisplay.
>  
>

Right.  I think what Carsten is saying is, if you might need to pause a
thread in the middle of Xlib, then that thread needs to make its own
call to XOpenDisplay, so that it has its own connection, separate from
the rest of the application.

-- 
Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.

___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Xlib : sequence lost (0x1718e > 0x71a0) in reply to 0x0!

2006-02-02 Thread niranjan
Hi
   thanks for replying quickly


 What do you mean by separate display  connections" ?
 The case is this :

I mean a display connection returned by XOpenDisplay.
Thanks

>>   u have given a good suggestion but I dont understand if the
>> pausing thread block any other thread trying to use the
>>Xlib with the same display connection then why it is working
>> fine sometimes .
>> Thanks
>
> that's life debugging and problems with threads. mostly you might be lucky
> and
> the threads don't clash and it HAPPENS to work - by sheer luck. when they
> do
> clash you end up with these "weird problems that happen sometimes" - ie
> concurrency/locking issues.
>
>>  Separate threads either need to use separate display
>> > connections or you need to enable thread mutexes for a shared
>> > connection (XInitThreads will enable Xlib's internal mutexes).
>> > Note still, that pausing a thread while it's in Xlib can block
>> > any other threads also trying to use Xlib with the same display
>> > connection.  You'd want to use separate display connections
>> > for that.
>> >
>> >Mark.
>> >
>> > On Tue, 31 Jan 2006 [EMAIL PROTECTED] wrote:
>> >
>> >>  Hi to all
>> >>
>> >>
>> >> Iam building an kde Application When  I pause the current pthread and
>> >>   invoke an dialog in another thread the following error is
>> coming .
>> >>
>> >> Xlib : unexpected async reply
>> >> Xlib :sequence lost (0x1718e > 0x71a0) in reply to 0x0!
>> >> X Error : BadImplementation (server does not implement opertaion) 17
>> >> Major opcode : 20
>> >> MInor opcode : 0
>> >> Resource id  : 0x759d1
>> >> The error is coming randomly , not always .
>> >>   Can any will help how to come out of this error .
>> >>
>> >>
>> >>  Thanks
>> >> ___
>> >> Devel mailing list
>> >> Devel@XFree86.Org
>> >> http://XFree86.Org/mailman/listinfo/devel
>> >>
>> > ___
>> > Devel mailing list
>> > Devel@XFree86.Org
>> > http://XFree86.Org/mailman/listinfo/devel
>> >
>>
>> ___
>> Devel mailing list
>> Devel@XFree86.Org
>> http://XFree86.Org/mailman/listinfo/devel
>>
>
>
> --
> - Codito, ergo sum - "I code, therefore I am" --
> The Rasterman (Carsten Haitzler)[EMAIL PROTECTED]
> $BMg9%B?(B
> Tokyo, Japan ($BEl5~(B $BF|K\(B)
> ___
> Devel mailing list
> Devel@XFree86.Org
> http://XFree86.Org/mailman/listinfo/devel
>

___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Xlib : sequence lost (0x1718e > 0x71a0) in reply to 0x0!

2006-02-01 Thread The Rasterman
On Wed, 1 Feb 2006 22:18:49 -0800 (PST) [EMAIL PROTECTED] babbled:

> Hi
>   u have given a good suggestion but I dont understand if the
> pausing thread block any other thread trying to use the
>Xlib with the same display connection then why it is working
> fine sometimes .
> Thanks

that's life debugging and problems with threads. mostly you might be lucky and
the threads don't clash and it HAPPENS to work - by sheer luck. when they do
clash you end up with these "weird problems that happen sometimes" - ie
concurrency/locking issues.

>  Separate threads either need to use separate display
> > connections or you need to enable thread mutexes for a shared
> > connection (XInitThreads will enable Xlib's internal mutexes).
> > Note still, that pausing a thread while it's in Xlib can block
> > any other threads also trying to use Xlib with the same display
> > connection.  You'd want to use separate display connections
> > for that.
> >
> > Mark.
> >
> > On Tue, 31 Jan 2006 [EMAIL PROTECTED] wrote:
> >
> >>  Hi to all
> >>
> >>
> >> Iam building an kde Application When  I pause the current pthread and
> >>       invoke an dialog in another thread the following error is coming .
> >>
> >> Xlib : unexpected async reply
> >> Xlib :sequence lost (0x1718e > 0x71a0) in reply to 0x0!
> >> X Error : BadImplementation (server does not implement opertaion) 17
> >> Major opcode : 20
> >> MInor opcode : 0
> >> Resource id  : 0x759d1
> >> The error is coming randomly , not always .
> >>   Can any will help how to come out of this error .
> >>
> >>
> >>  Thanks
> >> ___
> >> Devel mailing list
> >> Devel@XFree86.Org
> >> http://XFree86.Org/mailman/listinfo/devel
> >>
> > ___
> > Devel mailing list
> > Devel@XFree86.Org
> > http://XFree86.Org/mailman/listinfo/devel
> >
> 
> ___
> Devel mailing list
> Devel@XFree86.Org
> http://XFree86.Org/mailman/listinfo/devel
> 


-- 
- Codito, ergo sum - "I code, therefore I am" --
The Rasterman (Carsten Haitzler)[EMAIL PROTECTED]
裸好多
Tokyo, Japan (東京 日本)
___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Xlib : sequence lost (0x1718e > 0x71a0) in reply to 0x0!

2006-02-01 Thread niranjan
Hi
  u have given a good suggestion but I dont understand if the
pausing thread block any other thread trying to use the
   Xlib with the same display connection then why it is working
fine sometimes .
Thanks

 Separate threads either need to use separate display
> connections or you need to enable thread mutexes for a shared
> connection (XInitThreads will enable Xlib's internal mutexes).
> Note still, that pausing a thread while it's in Xlib can block
> any other threads also trying to use Xlib with the same display
> connection.  You'd want to use separate display connections
> for that.
>
>   Mark.
>
> On Tue, 31 Jan 2006 [EMAIL PROTECTED] wrote:
>
>>  Hi to all
>>
>>
>> Iam building an kde Application When  I pause the current pthread and
>>   invoke an dialog in another thread the following error is coming .
>>
>> Xlib : unexpected async reply
>> Xlib :sequence lost (0x1718e > 0x71a0) in reply to 0x0!
>> X Error : BadImplementation (server does not implement opertaion) 17
>> Major opcode : 20
>> MInor opcode : 0
>> Resource id  : 0x759d1
>> The error is coming randomly , not always .
>>   Can any will help how to come out of this error .
>>
>>
>>  Thanks
>> ___
>> Devel mailing list
>> Devel@XFree86.Org
>> http://XFree86.Org/mailman/listinfo/devel
>>
> ___
> Devel mailing list
> Devel@XFree86.Org
> http://XFree86.Org/mailman/listinfo/devel
>

___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Xlib : sequence lost (0x1718e > 0x71a0) in reply to 0x0!

2006-02-01 Thread Mark Vojkovich
   Separate threads either need to use separate display
connections or you need to enable thread mutexes for a shared
connection (XInitThreads will enable Xlib's internal mutexes).
Note still, that pausing a thread while it's in Xlib can block
any other threads also trying to use Xlib with the same display
connection.  You'd want to use separate display connections
for that.

Mark.

On Tue, 31 Jan 2006 [EMAIL PROTECTED] wrote:

>  Hi to all
>
>
> Iam building an kde Application When  I pause the current pthread and
>   invoke an dialog in another thread the following error is coming .
>
> Xlib : unexpected async reply
> Xlib :    sequence lost (0x1718e > 0x71a0) in reply to 0x0!
> X Error : BadImplementation (server does not implement opertaion) 17
> Major opcode : 20
> MInor opcode : 0
> Resource id  : 0x759d1
> The error is coming randomly , not always .
>   Can any will help how to come out of this error .
>
>
>  Thanks
> ___
> Devel mailing list
> Devel@XFree86.Org
> http://XFree86.Org/mailman/listinfo/devel
>
___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Xlib : sequence lost (0x1718e > 0x71a0) in reply to 0x0!

2006-02-01 Thread The Rasterman
On Tue, 31 Jan 2006 22:36:23 -0800 (PST) [EMAIL PROTECTED] babbled:

>  Hi to all
> 
> 
> Iam building an kde Application When  I pause the current pthread and
>   invoke an dialog in another thread the following error is coming .

application is using the same x display connection from multipel htreads
without any locking or enablign threadsafeness in xlib. it's an application
problem as such so you should direct this to the authors of that application or
the particular toolkit(s) it depends on that may create such silent threads.

> Xlib : unexpected async reply
> Xlib :    sequence lost (0x1718e > 0x71a0) in reply to 0x0!
> X Error : BadImplementation (server does not implement opertaion) 17
> Major opcode : 20
> MInor opcode : 0
> Resource id  : 0x759d1
> The error is coming randomly , not always .
>   Can any will help how to come out of this error .
> 
> 
>  Thanks
> ___
> Devel mailing list
> Devel@XFree86.Org
> http://XFree86.Org/mailman/listinfo/devel
> 


-- 
- Codito, ergo sum - "I code, therefore I am" --
The Rasterman (Carsten Haitzler)[EMAIL PROTECTED]
裸好多
Tokyo, Japan (東京 日本)
___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Xlib : sequence lost (0x1718e > 0x71a0) in reply to 0x0!

2006-01-31 Thread niranjan
 Hi to all


Iam building an kde Application When  I pause the current pthread and
  invoke an dialog in another thread the following error is coming .

Xlib : unexpected async reply
Xlib :sequence lost (0x1718e > 0x71a0) in reply to 0x0!
X Error : BadImplementation (server does not implement opertaion) 17
Major opcode : 20
MInor opcode : 0
Resource id  : 0x759d1
The error is coming randomly , not always .
  Can any will help how to come out of this error .


 Thanks
___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel