![]() |
|
|
google unix.com
|
|||||||
| Forum | Registrati | Regole Forum | Collegamenti | Album | FAQ | Members List | Calendario | Ricerca | Today's Posts | Mark Forums Read |
| Di programmazione ad alto livello Pubblica domande su C, C + +, Java, SQL, e di altri linguaggi di programmazione qui. |
Più di UNIX e Linux Forum Argomenti potreste trovare utili
|
||||
| Filo | Thread Starter | Forum | Risposte | Ultimo Post |
| semaforo | raguramtgr | UNIX for Dummies Domande & Risposte | 7 | 06-15-2009 10:39 AM |
| Semaphore | Jaken | Shell scripting e di programmazione | 2 | 04-04-2009 06:10 PM |
| dmidecode, velocità di RAM \u003d "Velocità attuale: Sconosciuto" | Santi | Filesystem, memoria e dischi | 0 | 02-16-2006 06:16 AM |
| Semaphore | vjsony | UNIX for Dummies Domande & Risposte | 3 | 04-07-2003 03:06 PM |
| semaforo | yls177 | UNIX for Dummies Domande & Risposte | 1 | 10-09-2002 12:18 AM |
|
|
LinkBack | Thread Tools | Cerca in questo Thread |
Rating:
|
Modalità di visualizzazione |
|
||||
|
semaforo velocità di accesso ai
Sono alcune indagini di bloccaggio regime utilizzando i semafori. Per valutare la velocità di base del sistema eseguire un ciclo di ottenere alcune informazioni semaforo e visualizzarla:
mentre:; fare. / semshow; fatto> res.txt Questo mi sono imbattuto su 3 caselle - due analoghi moderni HP Xeon scatole, eseguendo uno SCO OpenServer 5, l'altro è Fedora 2.6.9, e un vecchio PIII casella sotto Linux moderni (non hanno informazioni). I risultati sono molto controproducente intuitiva: H / W | OS | avg numero di piste numero sec ---- | --- | ------------------------- Xeon | SCO | 1700 Xeon | Fedora | 500 PIII | Linux (distribuzione recente, sconosciuto) | 900 Tutti e tre i sistemi sono stati praticamente inattivo a tempo l'esecuzione della prova. Vorrei chiedere, quali sarebbero i fattori che rende antica Unix a sovraperformare moderni sistemi operativi, inoltre, come mai PIII casella sovraperformare moderna Xeon casella sotto OS simili. Qualsiasi ponters sarebbe apprezzato. Il programma è molto semshow di base, consultare l'elenco qui di seguito: Codice:
#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/timeb.h>
#include <time.h>
#include "semlib.h"
#define MODE_CREATE 0
#define MODE_REMOVE 1
key_t IPCKEY;
main(int argc, char *argv[])
{
int sid, i;
pid_t last_rpid, last_wpid;
char dbuf[80];
union semun arg;
unsigned short vals[NSEMS];
struct timeb tb;
struct tm *tp;
if((IPCKEY = get_ipc_key()) == -1)
{
errexit("Can Not Obtain IPC Key");
}
if((sid = semget(IPCKEY, NSEMS, 0)) == -1)
{
errexit("Can Not Get Semaphore ID");
}
memset(vals, 0, sizeof(vals));
arg.array = &vals[0];
if(semctl(sid, NSEMS, GETALL, arg) == -1)
{
errexit("Can Not Get Semaphore Values");
}
if((last_rpid = semctl(sid, RDLOCK, GETPID)) == -1)
{
errexit("Can Not Get Semaphore R-Pid");
}
if((last_wpid = semctl(sid, WRLOCK, GETPID)) == -1)
{
errexit("Can Not Get Semaphore W-Pid");
}
ftime(&tb);
tp = localtime(&tb.time);
strftime(dbuf, sizeof(dbuf) - 1, "%T", tp);
printf("%12li.%03i %s RD:[%i] WR:[%i] %i/%i\n",
tb.time, tb.millitm, dbuf,
vals[RDLOCK], vals[WRLOCK],
last_rpid, last_wpid);
exit(0);
}
Codice:
#define NSEMS 2
#define RDLOCK 0
#define WRLOCK 1
union semun {
int val;
struct semid_ds *buf;
unsigned short *array;
};
|
| Segnalibri |
| Thread Tools | Cerca in questo Thread |
| Modalità di visualizzazione | Vota questo thread |
|
|