Re: Strange behaviour with Xilkernel
- From: "FJ.Perogil" <pperogil@xxxxxxxxx>
- Date: Tue, 22 Jul 2008 11:41:43 -0500
Hello Paco,
With the new code you post I think the problem is the same.
The problem is not only the time spent in context switch, also the
time in system calls is important: pthread_create and pthread_join are
both system calls that will spent many cycles running with interrupts
disabled (can't guess how many, but probably equal or more than a
context switch, you can measure it with another timer if you are
interested in the exact time it's spent).
If you are interested in measuring the time some functions spent, I
recommend you to use another timer and not to use the
xget_clocks_ticks(). If you use another timer, you can use it to count
exact cycles a function call spends, instead making 100000 calls and
calculating the mean time.
Answering your questions:
"Is too heavy the context switch in Xilkernel?" I think it is not too
heavy. I have studied the code and it's quite optimal. If you are
interested I can measure how many cycles it spends.
"Is the context switch done with interrupts disabled?" Yes. A context
switch can be reachead by two ways: a timer interrupt, or a system
call like yield(), pthread_join(), pthread_exit(), etc. In both
situations the interrupts are disabled.
Best regards,
Pablo H
PD. Saludos a Pablo. Cualquier cosa que pueda ayudar no dudes en
preguntar.
Pablo,
I appreciate very much your advices. I will try to use another timer as
you point out.
Saludos,
Paco
.
- References:
- Strange behaviour with Xilkernel
- From: pperogil
- Re: Strange behaviour with Xilkernel
- From: Newman
- Re: Strange behaviour with Xilkernel
- From: Pablo H
- Re: Strange behaviour with Xilkernel
- From: pperogil
- Re: Strange behaviour with Xilkernel
- From: Pablo H
- Strange behaviour with Xilkernel
- Prev by Date: Re: XAUI v7.2 - timing issue - *channel bonding attributes*
- Next by Date: Re: help needed for Virtex-4
- Previous by thread: Re: Strange behaviour with Xilkernel
- Next by thread: Re: Strange behaviour with Xilkernel
- Index(es):
Relevant Pages
|