Jump to content

Recommended Posts

Posted

Hello ,

i have a scenario where there is tlm scokets btw two module

Module 1 have two threads A & B running independently and module 2 has single thread  C

now i problem is thread1 is activated first(assume) and after some transaction waits in b_transport ,

by wait here i mean some qeue is there which is updated by thread C .now thread B becomes active

and call b_transport which brings the thread A out of wait (it doesnt suppose to happen as it qeue is not updated)

and produce unwanted result ...

 

how to control this ...right now i am using a while loop in wait qeue for thread A so that it keep on waiting (it is working)

but not sure whether it is the right appoarch ....

 

hope u understand ...pls help 

Posted

Some code (even pseudo) would help with understanding your need. Your description is unclear.

pseudo code as-

Module 1 -> module 2 (TM connection)

in module 1

{

    thread1();{

       taking data X from qeueu 1

    }

    thread 2();{

       taking data Y from qeueu 2

    }

}

 

module 2

{

   btransport (){

      if queue 1 is empty then wait

     else read data from queue 1

   }

 

}

 

note 1 - queue 1 is filled from thread in module 2 contains data for both thread1 and thread 2

 

now the issue is at some stage both thread 1 and thread 2 are waiting for data to be written on queue1 ...

now as soon as data is written on queue 1 i want to control which thread to trigger from module 1 as order of data is not fixed ..

 

any solution suggested here ...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...