[Click] [click] userlevel multi-threads

jinho hwang hwang.jinho at gmail.com
Wed Aug 14 10:38:55 EDT 2013


On Wed, Aug 14, 2013 at 7:23 AM, Beyers Cronje <bcronje at gmail.com> wrote:
> You need to use either StaticThreadSched or BalancedThreadSched  to
> schedule tasks on different threads.
>
> http://read.cs.ucla.edu/click/elements/staticthreadsched
> http://read.cs.ucla.edu/click/elements/balancedthreadsched
>
> An example of how to use StaticThreadSched would be:
>
> fd0::FromDevice(eth0) -> Discard;
> fd1::FromDevice(eth1) -> Discard;
> StaticThreadSched(fd0 0, fd1 1);
>
> Beyers
>
>
> On Wed, Aug 14, 2013 at 5:23 AM, jinho hwang <hwang.jinho at gmail.com> wrote:
>
>> Hi All,
>>
>> I am new to click. I want to use multi-threading in userlevel. I enabled
>> and put -j 2 in command line, and am using test.click. However, thread_id=0
>> always calls run_task and processes the packets, but thread_id=1 appears in
>> RouterThread, but then is not called at all from run_task in
>> infinitesource. thread_id=1 even disappeared after calling twice. This is
>> consistent. I could not figure out why thread_id=1 disappeared. There is no
>> signal delivered to the thread (checked), it seems naturally gone.
>>
>> Can anybody help?
>>
>> Thank you,
>>
>> Jinho

Hi Beyers,

Thank you. It works like charm, and fits to my goal. One more question
is whether it uses cpu affinity? From my analysis, there is no such
thing. I have to fix each thread to each core. Does Click have CPU
affinity option somewhere? Otherwise, I will add that for my purpose.

Thanks,

Jinho


More information about the click mailing list