Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dsdp-tcf-dev] TCF protocol thread safe?

Hi Karun,
 
OK, as I understand, your code is derived from cmdline.c
 
Now, if by "thread safe" you mean global multithreading support, the answer is "no".
Global multithreading is intentionally prohibited: most of public functions declared in TCF header files can be called on main thread only.
Only few functions are thread safe, most notable one is post_event() that allows to call a function on main thread.
 
However, this does not prevent you from creating multiple instances of command handlers and connecting to multiple targets.
TCF APIs are asynchronous and call-back based, which allows same level of concurrency as multithreading.
 
Regards,
Eugene


From: dsdp-tcf-dev-bounces@xxxxxxxxxxx [mailto:dsdp-tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Karun SARASWAT
Sent: Wednesday, September 08, 2010 8:30 PM
To: DSDP TCF dev list
Subject: Re: [dsdp-tcf-dev] TCF protocol thread safe?

HI Eugene,

 

I modified the command line handler with my own which posted tcf commands after reading test cases list. So you can say it is kind of script. Actually I implemented this on a old version of tcf which had only command line functionality and no script file handling. So I made my own handler for reading my test case list and launching the test cases.

 

I hope it is clear now.

 

Regards,

Karun

 

From: dsdp-tcf-dev-bounces@xxxxxxxxxxx [mailto:dsdp-tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Tarassov, Eugene
Sent: Wednesday, September 08, 2010 22:27
To: DSDP TCF dev list
Subject: Re: [dsdp-tcf-dev] TCF protocol thread safe?

 

Hi Karun,

 

I'm not sure I understand your question.

What do you mean by "wrapper around client"?

Is it a script that uses TCF command line client?

Or, are you using TCF API? Which one - C or Java?

 

Regards,

Eugene

 


From: dsdp-tcf-dev-bounces@xxxxxxxxxxx [mailto:dsdp-tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Karun SARASWAT
Sent: Wednesday, September 08, 2010 4:02 AM
To: dsdp-tcf-dev@xxxxxxxxxxx
Subject: [dsdp-tcf-dev] TCF protocol thread safe?

Hi all,

 

I have developed my regression test framework for testing linux device drivers with TCF. Process service is used for launching my target test cases and client running on PC records the result. I have developed a wrapper around client to parse my test case files and manage the flow of the test case execution.

 

Now i wish to extend it further by allowing multiple instances of regression running on different target ( test case distribution) or multiple instance of agent on same target. For this i want to run multiple threads of client handler managing each agent connection.

 

I want to know if TCF is thread safe if i instantiate multiple instances of client or to be specific multiple handlers each connecting to different targets? I want to handle context for each thread differently. I guess for now only one handler is present which is over written for each connect command. Can we support multiple handlers by generating unique handler for each connection?

 

Please correct me if I have misunderstood anything.

 

Thanks and regards,

Karun

 


Back to the top