Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - io-pkt hangs because of nw_pthread_create function.: (10 Items)
   
io-pkt hangs because of nw_pthread_create function.  
Hi,

I have 2 different network drivers  (devnp-sam1.so and devnp-sam2.so).

devnp-sam1.so  - handling messages 
=========
1.i have created the resource manger ,nw_pthread_create() in iopkt entry function.
2.In thread handler function is in busy loop to handle all the messages 

code snippet - devnp-sam1.so
========
iopkt_entry
{
/* i create resource manager also. */
nw_thread_create(&thid,0,my_handler,NULL,0,my_init,NULL);
}

my_init()
{
           struct nw_work_thread *wtp;
           wtp = WTP;
          wtp->quiesce_callout = my_quiesce;
          return EOK;
}

my_quiesce()
{
 printf(" inside quiesce\n");
}
my devnp-sam1.so loaded successfully.

devnp-sam1.so
=========
1.this is  my network driver for handling the packets.

my second driver also loaded successfully.

if my application try to access my devnp-sam2.so(network driver) its hanged.

After that if i do ifconfig its also hanged.

if i load only one driver either devnp-sam1.so  or devnp-sam2.so.
the drivers are working properly,my application is not hanging.

But if i load both the driver and run my application.
if i run my application my_quiesce function got invoked and displays 
"inside quiesce" and then iopkt got hanged.

What should i do to run my network driver simulatenously.

Please help me if i missing any thing.

Thanks and Regards
K.Senthil











Re: io-pkt hangs because of nw_pthread_create function.  
On Tue, Dec 15, 2009 at 06:38:11AM -0500, Senthil K wrote:
> my_quiesce()
> {
>  printf(" inside quiesce\n");
> }

> 
> But if i load both the driver and run my application.
> if i run my application my_quiesce function got invoked and displays 
> "inside quiesce" and then iopkt got hanged.
> 
> What should i do to run my network driver simulatenously.

my_quiesce() is obviously incomplete.  It has to
poke your thread into calling quiesce_block().
The main thread in waiting for this to happen.

-seanb
Re: io-pkt hangs because of nw_pthread_create function.  
Hi Sean,

Thanks for ur reply,
I have refered some of the code in QNX 6.4.1 Networking source code in which theyare using quiesce_callout function.

Inside the quiesce_callout function,they are using 

ex 1:
====
quiesce_block(0) 

ex -2:
=====
quiesce_block(1)

what is the difference  of passing 0 and 1 in quiesce_block function?

Thanks and Regards
K.Senthil
Re: io-pkt hangs because of nw_pthread_create function.  
> what is the difference  of passing 0 and 1 in quiesce_block function
"Use the source Luke" :-)

Take a look at the code lib/io-pkt/sys/quiesce.c

/P
Re: io-pkt hangs because of nw_pthread_create function.  
Hi,
I have used quiese_block(1) and quiesce_block(0) in my quiesce_callout function.
but still its hanging.

Thanks and Regards
K.Senthil
Re: io-pkt hangs because of nw_pthread_create function.  
On Wed, Dec 16, 2009 at 05:34:44AM -0500, Senthil K wrote:
> Hi,
> I have used quiese_block(1) and quiesce_block(0) in my quiesce_callout function.
> but still its hanging.
> 

You don't call it from the quiesce_callout().  quiesce_callout() is
supposed to poke your newly created thread into calling it.  For
example, if one were to create a thread that blocks in MsgReceive(),
queiesce_callout() might send it a pulse with a pre-determined code
to unblock it and call quiesce_block().  This 'poking' mechanism
is up to you as you control the communication mechanism between
quiesce_callout() and your newly created thread.

-seanb
Re: io-pkt hangs because of nw_pthread_create function.  
Hi Sean,

Thanks for reply.

yesterday i told that if i do ifconfig its hanging.But today my observation is its hanging for 4-5 minutes and then 
command prompt is coming.

once again if i give ifconfig its hanging.

i think this because of my network thread not scheduling properly.

Please help me.


Thanks and Regards
K.Senthil
Re: io-pkt hangs because of nw_pthread_create function.  
Hi Sean,


Thanks a lot for your support and reply.

I  have followed nw_phtread_creation from nraw_res.c,Now I am able to load my 2  different drivers in io-pkt thread.

Thanks and Regards
K.Senthil

Re: io-pkt hangs because of nw_pthread_create function.  
hi all

Please attach the file "nraw_res.c" on this post, or show an example of code using "nw_pthread_create"

I can not understand how to use "quiesce_block", because after the call, as well as "quiesce_callout" - it hangs "io-pkt
", all threads are in a state CONDVAR - and wait some event.

In the help function on "nw_pthread_create" has a reference to "net/ppp_tty.c", where can I get it?!

thank you.
Re: io-pkt hangs because of nw_pthread_create function.  
Unfortunately source code access is closed. You will have to contact
sales/support.