Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linuxÏ̵߳ÄÓÅÏȼ¶ÉèÖÃ

linux²¢²»ÊÇʵʱ²Ù×÷ϵͳ£¬°ÑÏÂÃæµÄ´úÂëÔËÐÐÒ»±é¾ÍÄܹ»Àí½âÁË£¬´úÂëÓкÜÏêϸµÄ×¢ÊÍ¡£
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <signal.h>
#include <string.h>
void * thr_fun(void *arg)
{
int policy, ret;
struct sched_param param;
//»ñÈ¡Ï̵߳÷¶È²ÎÊý
ret = pthread_getschedparam(pthread_self(), &policy, &param);
if(ret!=0)
{
printf("pthread_getschedparam %s\n", strerror(ret) );
exit(1);
}
if (policy == SCHED_FIFO)
{
printf("policy:SCHED_FIFO\n");
}
else if (policy == SCHED_OTHER)
{
printf("policy:SCHED_OTHER\n");
}
else if (policy == SCHED_RR)
{
printf("policy:SCHED_RR\n");
}
printf("param:%d\n", param.sched_priority);
long long i;
while (1) {
i++;
i *= 2;
}
pthread_exit(NULL);
}
int main(void)
{
int ret;
pthread_t tid;
pthread_attr_t attr;
int policy, inher;
struct sched_param param;

//³õʼ»¯Ïß³ÌÊôÐÔ
pthread_attr_init(&attr);
//»ñÈ¡¼Ì³ÐµÄµ÷¶È²ßÂÔ
ret = pthread_attr_getinheritsched(&attr, &inher);
if (ret!=0)
{
printf("pthread_attr_getinheritsched\n%s\n", strerror(ret));
exit(1);
}
//
if (inher == PTHREAD_EXPLICIT_SCHED)
{
printf("PTHREAD_EXPLICIT_SCHED\n");
}
else if (inher == PTHREAD_INHERIT_SCHED)
{
printf("PTHREAD_INHERIT_SCHED\n");
inher = PTHREAD_EXPLICIT_SCHED;
}
//ÉèÖü̳еĵ÷¶È²ßÂÔ
//±ØÐèÉèÖÃinherµÄÊôÐÔΪ PTHREAD_EXPLICIT_SCHED£¬·ñÔòÉèÖÃÏ̵߳ÄÓÅÏȼ¶»á±»ºöÂÔ
ret = pthread_attr_setinheritsched(&attr, inher);
if (ret!=0)
{
printf("pthread_attr_setinheritsched\n%s\n", strerror(ret));
exit(1);
}

policy = SCHED_FIFO;//ÔÚUbuntu9.10ÉÏÐèÒªrootȨÏÞ
//ÉèÖÃÏ̵߳÷¶È²ßÂÔ
ret = pthread_attr_setschedpolicy(&attr, policy);
if (ret!=0)
{
printf(" pthread_attr_setschedpolicy\n%s\n", strerror(ret));
exit(1);
}
param.sched_priority = 3;
//ÉèÖõ÷¶È²ÎÊý
ret = pthread_attr_setschedparam(&attr,


Ïà¹ØÎĵµ£º

Linuxϰ²×°ÅäÖà jdk1.6 tomcat6 Apache2.2 jk mod1.2

±¾ÎÄת×Ô http://zhzhiqun2005.javaeye.com/blog/462799
Linuxϰ²×°ÅäÖà Jdk1.6+Tomcat6+Apache2.2.x+jk_mod1.2 Ïê½â



Linuxϰ²×°ÅäÖà Jdk1.6+Tomcat6+Apache2.2.x+jk_mod1.2 Ïê½â
±¾ÆªÒÔRedhat AS5£¬ÄÚºËΪLinux 2.6.18-8.el5 ΪÀý£¬ÆäÖÐRedhat/FedoraϵÁлù±¾Ò»Ö£¬ÆäËûLinux»òÕß° ......

dzÎöLinuxÏÂcoreÎļþ

µ±ÎÒÃǵijÌÐò±ÀÀ£Ê±£¬ÄÚºËÓпÉÄܰѸóÌÐòµ±Ç°ÄÚ´æÓ³Éäµ½coreÎļþÀ·½±ã³ÌÐòÔ±ÕÒµ½³ÌÐò³öÏÖÎÊÌâµÄµØ·½¡£×î³£³ö
Ïֵ쬼¸ºõËùÓÐC³ÌÐòÔ±¶¼³öÏÖ¹ýµÄ´íÎó¾ÍÊÇ“¶Î´íÎó”ÁË¡£Ò²ÊÇ×îÄѲé³öÎÊÌâÔ­ÒòµÄÒ»¸ö´íÎó¡£ÏÂÃæÎÒÃǾÍÕë¶Ô“¶Î´íÎó”À´·ÖÎöcoreÎļþµÄ²úÉú¡¢ÒÔ¼°ÎÒÃÇ
ÈçºÎÀûÓÃcoreÎļþÕÒµ½³öÏÖ±ÀÀ£µÄµØ· ......

LINUXϹÒÔØusb

Ò»ÔçÉ϶¼ÊÇŪÔÚLINUXϹÒÔØusb£¬ºÜÎÞÓ¼¸ºõÕÒ±éÁËËùÓÐÍøÉÏÈ˼ҽéÉܵķ½·¨£¬¿É¶ÔÓÚÒ»¸öÐÂÊÖÀ´Ëµ£¬ËûÃÇ´ó¶¼½²µÄ²»Çå³þ²»³þ£¬×îºó»¹ÊǾõµÃÕâ¸ö±È½Ï·½·¨±È½Ï³É¹¦£¬ËùÒÔÌù³öÀ´´ó¼Ò·ÖÏí£¬Ëµ²»¶¨ÒÔºó»¹ÄÜÓõõ½
1.USBÒÆ¶¯´æ´¢É豸ͨ³£±»Ê¶±ðΪsda1£¬¾ßÌå¿ÉÒÔͨ¹ýfdisk -lÃüÁî²éѯ¡£Ò»°ãÍâ¹ÒµãµÄ×ÓĿ¼¶¼Êǽ¨Á¢ÔÚ/mntÀïÃæµÄ ʹÓà ......

ÔÚlinux gcc 64λƽ̨±àÒ붯̬Á´½Ó¿âʱ³öÏÖµÄÎÊÌâ

ÔÚ32λƽ̨ÉϱàÒ붯̬¿âûÓÐɶÎÊÌ⣬Äõ½x86_64λƽ̨ÉϱàÒëʱ³öÏÖÁËÎÊÌâ¡£
relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
ÕÕ×ÅÌáʾ±àÒë´úÂëµÄʱºò¼ÓÈë -fPICÑ¡Ïî¾Íok.
......

LinuxÏÂʱÖÓͬ²½

ÏÂÊöÉèÖÃÒÔʱÖÓÔ´·þÎñÆ÷IPµØÖ·Îª192.168.0.1ΪÀý¡£¿ÉÒÔÃüÁîntpstat ºÍ ntpq -p ²é¿´±¾»úNTPD·þÎñ״̬¡£ÅäÖÃÍê³Éºó£¬¾ùÐèÒªÖØÐÂÆô¶¯NTPD·þÎñ service ntpd restart
   ¡¾·þÎñÆ÷¶ËÉèÖá¿
   1.½«/etc/ϵÄÎļþntp.confÐÞ¸ÄÈçÏ£º
   server 127.127.1.0 minpoll 4 maxpoll 5 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ