This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/207] ucontext is very slow.
- From: "a dot darovskikh at compassplus dot ru" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 9 Jun 2004 04:31:01 -0000
- Subject: [Bug libc/207] ucontext is very slow.
- References: <20040607084537.207.a.darovskikh@compassplus.ru>
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
------- Additional Comments From a dot darovskikh at compassplus dot ru 2004-06-09 04:30 -------
Subject: Re: ucontext is very slow.
On Tuesday 08 June 2004 20:38, jakub at redhat dot com wrote:
> ------- Additional Comments From jakub at redhat dot com 2004-06-08 14:38
> ------- Hardly.
> More than 50% of the time is spent in sigprocmask syscalls, which are
> needed (the program can change its signal mask any time and this needs to
> be preserved, caching current signal mask in userland would be a huge can
> of problems and slowdowns for little gain).
> The other big part of the total time is spent on saving/restoring FPU state
> (again, swapcontext must do this) and that's about it.
>
> Why aren't you using real threads instead?
This is because we use thousands so-called "tasks", which access on the same
"tree". If we implement it using real threads, they will use complex
synchronization, which will take much more time than the real work. This is
why we need cooperative multitasking. There are some more complex reasons for
this, so I'm afraid, we will not able to use real threads. Indeed, we do use
it, but it's for external things, like database connections.
Is it possible to avoid sigprocmask syscalls and FPU things? We do not use it.
Maybe it's possible to take this code and remove those calls from it? Or use
something like setjmp/longjmp? I tried last one, but timings were even worse.
Alexander Darovsky.
--
http://sources.redhat.com/bugzilla/show_bug.cgi?id=207
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.