From: Epiphanov Sergei <serpiph@nikiet.ru> To: "Рассылка Sisyphus" <sisyphus@altlinux.ru> Subject: [sisyphus] Ядра 2.4 и 2.6 - в чём различия? Date: Fri, 26 Nov 2004 11:46:45 +0300 Message-ID: <200411261146.45372.serpiph@nikiet.ru> (raw) [-- Attachment #1: Type: text/plain, Size: 677 bytes --] Есть программка (в аттаче). Если её собрать и запустить, получаются следующие результаты: 1. ядро 2.4.27-std-up-alt1 и 2.4.27-std-smp-alt1 Execution time=5.99862 seconds 2. ядро 2.6.9-std26-smp-alt11 Execution time=6.09922 seconds В обоих случаях запускал и под обычным пользователем, и под root с nice=-20 в runlevel=3 и runlevel=1. Результат практически не меняется. То же самое обнаружил и в сложной программе: на ядре 2.6 таймер растягивает время вне зависимости от шага таймера (можно поставить и 30мс, и 300мс) и вывода на экран. В чём может быть проблема и как её обойти на 2.6 (мне это ядро боьше нравится)? -- С уважением, Епифанов Сергей [-- Attachment #2: testschm.cpp --] [-- Type: text/x-c++src, Size: 2677 bytes --] /*************************************************************************** * Copyright (C) 2004 by Epiphanov Sergei * * serpiph@nikiet.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <iostream> #include <cstdlib> #include <string.h> #include <signal.h> #include <sys/time.h> #include <sys/ipc.h> #include <sys/shm.h> void handler(int i){ return; } using namespace std; int main(int argc, char *argv[]) { //cout << "Hello, world!" << endl; struct timeval begin, end; struct timezone tz __attribute__ ((__unused__)); struct sigaction sa; memset( &sa, 0, sizeof( sa) ); sa.sa_handler = handler; sigaction( SIGALRM, &sa, NULL ); struct itimerval tv; tv.it_interval.tv_sec = 0; tv.it_interval.tv_usec = 60000; tv.it_value.tv_sec = 0; tv.it_value.tv_usec = 60000; setitimer( ITIMER_REAL, &tv, NULL ); gettimeofday( &begin, &tz); for( int i=0; i<100; i++){ pause(); cout << "Number=" << i << "\n"; } gettimeofday( &end, &tz); cout << "Execution time=" << (end.tv_sec-begin.tv_sec)+ ((float)end.tv_usec-(float)begin.tv_usec)/1e6<< " seconds\n"; tv.it_interval.tv_usec = 0; tv.it_value.tv_usec = 0; setitimer( ITIMER_REAL, &tv, NULL ); sa.sa_handler = SIG_DFL; sigaction( SIGALRM, &sa, NULL ); return EXIT_SUCCESS; }
reply other threads:[~2004-11-26 8:46 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=200411261146.45372.serpiph@nikiet.ru \ --to=serpiph@nikiet.ru \ --cc=sisyphus@altlinux.ru \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Sisyphus discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \ sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru public-inbox-index sisyphus Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.sisyphus AGPL code for this site: git clone https://public-inbox.org/public-inbox.git