Discussion:
[Pixil-devel] ask for help
t***@skyworksinc.com
2006-01-24 09:47:58 UTC
Permalink
Hello,

my name is tao and I am application engineer in skyworks china, i have
download the pixil-1.2.3 and read its code,
there are one thing confuse me in function client_WaitForServer(...) in
client.c,
during wait for special type message,it will queue all other type
message, after successly receive the specail
type message, it will do write zero length data into sock if queued other
type message,

write(sock, 0, 0);

i don't understant the the effect of this write operation, i will
appreciate any comments,

static int
client_WaitForServer(int sock, int packet_type, pkt_buff_t **pkt, int
timeout)
{
do{
...
if(qcount)
write(sock,0,0);
return (0);
...
}
}



thanks you very much, in advance!

regards
tao
t***@skyworksinc.com
2006-02-08 02:01:52 UTC
Permalink
hi all,
i guest the side effect of wirte(sock, 0, 0) is to make this sock
readable, so than when some packet queued, it make the
sock readable, so when client use select(...) call, it will return
immedialely, not blocked forever if no new packet in, and
have chance to get packet queued, if it right? anybody can give me some
comment? thanks in advacnce

best regards
tao





***@skyworksinc.com
Sent by: pixil-devel-***@pixil.org
01/24/2006 05:47 PM

To
pixil-***@pixil.org
cc

Subject
[Pixil-devel] ask for help







Hello,

my name is tao and I am application engineer in skyworks china, i have
download the pixil-1.2.3 and read its code,
there are one thing confuse me in function client_WaitForServer(...) in
client.c,
during wait for special type message,it will queue all other type
message, after successly receive the specail
type message, it will do write zero length data into sock if queued other
type message,

write(sock, 0, 0);

i don't understant the the effect of this write operation, i will
appreciate any comments,

static int
client_WaitForServer(int sock, int packet_type, pkt_buff_t **pkt, int
timeout)
{
do{
...
if(qcount)
write(sock,0,0);
return (0);
...
}
}



thanks you very much, in advance!

regards
tao_______________________________________________
Pixil-devel mailing list
Pixil-***@pixil.org
http://www.pixil.org/cgi-bin/mailman/listinfo/pixil-devel
Greg Haerr
2006-02-08 17:49:19 UTC
Permalink
: i guest the side effect of wirte(sock, 0, 0) is to make this sock
: readable, so than when some packet queued, it make the
: sock readable, so when client use select(...) call, it will return
: immedialely, not blocked forever if no new packet in, and
: have chance to get packet queued, if it right?

I believe that the write is to trigger any pending selects
to unblock their threads/processes.

Regards,

Greg
t***@skyworksinc.com
2006-02-10 02:23:44 UTC
Permalink
Hi Greg,


thanks for your advice, i think the author is want following effect

during ipc client wait for the reply of request, if it have queued some
unsolicited packet, it want to make sock readable for ipc client, so that
it can exit immediately next time when call select(...), and the packet
queued
will have opportunity to been processed immediately.

this effect is very important for the application when it's the client of
IPC & Nano-X
at the same time.


but after some experiment, i regretlly find it don't have the effect!

i do as following step
(1) run ipc server (clserver)

(2) the ipc client make request to server and retrieve its
reply,
after that the ipc server has been blocked in
select(...)

(3) the ipc client directly write(sock, 0, 0), and find
the ipc server don't unblock from select,

(4) then the ipc client call select, it also blocked in
this
call

or i misunderstand it.

thanks & regards
tao





"Greg Haerr" <***@censoft.com>
02/09/2006 01:49 AM

To
<***@skyworksinc.com>
cc
<pixil-***@pixil.org>, <pixil-devel-***@pixil.org>
Subject
Re: [Pixil-devel] ask for help






: i guest the side effect of wirte(sock, 0, 0) is to make this sock

: readable, so than when some packet queued, it make the
: sock readable, so when client use select(...) call, it will return
: immedialely, not blocked forever if no new packet in, and
: have chance to get packet queued, if it right?

I believe that the write is to trigger any pending selects
to unblock their threads/processes.

Regards,

Greg
t***@skyworksinc.com
2006-02-14 05:36:38 UTC
Permalink
Hi Greg,

thank you very much for your advice!

i want solve it by followint way:

first add IPC client fd into Nano-X select fd set, and drain out all
the queued message in IPC fd each time before call Nano-X
GrWaitNextEvent(...), i wish it can work fine.

thanks & best regards
tao





"Greg Haerr" <***@censoft.com>
02/14/2006 12:53 PM
Please respond to
"Greg Haerr" <***@censoft.com>


To
<***@skyworksinc.com>
cc

Subject
Re: [Pixil-devel] ask for help






Tao -
Sorry my response is so slow. I do not know the PIXIL
code very well, only Microwindows. I would suggest removing
the write(...,0) code if is causing problems, and perhaps
adding a timeout to select(), so that your IPC client calls
will still work. Would this solve your problem?

Regards,

Greg
----- Original Message -----
From: ***@skyworksinc.com
To: Greg Haerr
Cc: pixil-***@pixil.org ; pixil-devel-***@pixil.org
Sent: Thursday, February 09, 2006 7:23 PM
Subject: Re: [Pixil-devel] ask for help


Hi Greg,


thanks for your advice, i think the author is want following effect

during ipc client wait for the reply of request, if it have queued some
unsolicited packet, it want to make sock readable for ipc client, so that
it can exit immediately next time when call select(...), and the packet
queued
will have opportunity to been processed immediately.

this effect is very important for the application when it's the client of
IPC & Nano-X
at the same time.


but after some experiment, i regretlly find it don't have the effect!

i do as following step
(1) run ipc server (clserver)

(2) the ipc client make request to server and retrieve its
reply,
after that the ipc server has been blocked in
select(...)

(3) the ipc client directly write(sock, 0, 0), and find
the ipc server don't unblock from select,

(4) then the ipc client call select, it also blocked in
this
call

or i misunderstand it.

thanks & regards
tao




"Greg Haerr" <***@censoft.com>
02/09/2006 01:49 AM


To
<***@skyworksinc.com>
cc
<pixil-***@pixil.org>, <pixil-devel-***@pixil.org>
Subject
Re: [Pixil-devel] ask for help








: i guest the side effect of wirte(sock, 0, 0) is to make this sock

: readable, so than when some packet queued, it make the
: sock readable, so when client use select(...) call, it will return
: immedialely, not blocked forever if no new packet in, and
: have chance to get packet queued, if it right?

I believe that the write is to trigger any pending selects
to unblock their threads/processes.

Regards,

Greg

Continue reading on narkive:
Loading...