Hi,
    I am trying to launch a function called lthread_init(), on a logical
core using rte_eal_remote_launch from main (), then creating an lthread
which has only lthread_exit() in the thread body and lthread_run() in the
lthread_init() and then calling a function lthread_main_spawner() from
main(), which creates an lthread (lthread_spawner ) and a scheduler
lthread_run (), this lthread_spawner() creates three more lthreads, you can
see the code below

main ()
{

      /** rte_eal_init () and other necessary initialisations */
      ....
      rte_eal_remote_launch ( lthread_init, NULL, 2);
      lthread_main_spawner(NULL);
}
static int lthread_init ( void *arg )
{
     struct lthread *lt;
     lthread_create ( &lt, -1, lthread_start, NULL );
     lthread_run();
     return 0;
}
static void *lthread_start ( void *args )
{
      ....
      lthread_exit( NULL );
      return NULL;
}
static int lthread_main_spawner ( void *arg )
{
     struct lthread *lt;
     lthread_create ( &lt, -1, lthread_spawner, NULL );
     lthread_run();
     return 0;
}
static void *lthread_spawner ( void )
{
      struct lthread *lt1, *lt2, *lt3;
      lthread_create ( &lt1, -1, fun1, NULL );
      lthread_create ( &lt2, -1, fun2, NULL );
      lthread_create ( &lt3, -1, fun3, NULL );
      lthread_sleep ( 1000 );
      lthread_join ( lt1, NULL );
      lthread_join ( lt2, NULL );
      lthread_join ( lt3, NULL );
      return NULL;
}
void fun1 ()
{
   while ( 1)
  {
      printf (" in lthread 1 \n");
      lthread_yield();
   }
}
void fun2 ()
{
   while ( 1)
   {
     printf (" in lthread 2 \n");
     lthread_yield();
   }
}
void fun3 ()
{
  while ( 1)
  {
     printf (" in lthread 3 \n");
     lthread_yield();
  }
}

the code is working fine in x86 systems but it is getting segmentation
fault on ARM64 processor with 4 logical cores at ctx_switch () function in
_lthread_resume() which is called from lthread_run() function.
I even tried just creating an lthread in a function called from
rte_eal_remote_launch(), but i am getting the same issue

Can you please help me in debugging the issue, is there any implementation
changes need to be done ?

Thanks and Regards,
Hemasai.

Reply via email to