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

linuxÏÂCÓïÑÔ¶àÏ̱߳à³ÌʵÀý


À¼´óÂÛ̳ÉϵÄÒ»¸öÌû×Ó¡«¡«
ѧ¶«Î÷£¬ÍùÍùʵÀý²ÅÊÇ×îÈÃÈ˸ÐÐËȤµÄ£¬ÀÏÊÇѧ»ù´¡ÀíÂÛ£¬²»¶¯ÊÖ£¬¸Ð¾õûÓгɾ͸У¬ºÇºÇ¡£
ÏÂÃæÏÈÀ´Ò»¸öʵÀý¡£ÎÒÃÇͨ¹ý´´½¨Á½¸öÏß³ÌÀ´ÊµÏÖ¶ÔÒ»¸öÊýµÄµÝ¼Ó¡£
»òÐíÕâ¸öʵÀýûÓÐʵ¼ÊÔËÓõļÛÖµ£¬µ«ÊÇÉÔ΢¸Ä¶¯Ò»Ï£¬ÎÒÃǾͿÉÒÔÓõ½ÆäËûµØ·½È¥À­¡£
ÏÂÃæÊÇÎÒÃǵĴúÂ룺
/*thread_example.c : c multiple thread programming in linux
*author : falcon
*E-mail : tunzhj03@st.lzu.edu.cn
*/
#include <pthread.h>
#include <stdio.h>
#include <sys/time.h>
#include <string.h>
#define MAX 10
pthread_t thread[2];
pthread_mutex_t mut;
int number=0, i;
void *thread1()
{
printf ("thread1 : I'm thread 1\n");
for (i = 0; i < MAX; i++)
{
printf("thread1 : number = %d\n",number);
pthread_mutex_lock(&mut);
number++;
pthread_mutex_unlock(&mut);
sleep(2);
}
printf("thread1 :Ö÷º¯ÊýÔÚµÈÎÒÍê³ÉÈÎÎñÂð£¿\n");
pthread_exit(NULL);
}
void *thread2()
{
printf("thread2 : I'm thread 2\n");
for (i = 0; i < MAX; i++)
{
printf("thread2 : number = %d\n",number);
pthread_mutex_lock(&mut);
number++;
pthread_mutex_unlock(&mut);
sleep(3);
}
printf("thread2 :Ö÷º¯ÊýÔÚµÈÎÒÍê³ÉÈÎÎñÂð£¿\n");
pthread_exit(NULL);
}
void thread_create(void)
{
int temp;
memset(&thread, 0, sizeof(thread)); //comment1
/*´´½¨Ïß³Ì*/
if((temp = pthread_create(&thread[0], NULL, thread1, NULL)) != 0) //comment2
printf("Ïß³Ì1´´½¨Ê§°Ü!\n");
else
printf("Ïß³Ì1±»´´½¨\n");
if((temp = pthread_create(&thread[1], NULL, thread2, NULL)) != 0) //comment3
printf("Ïß³Ì2´´½¨Ê§°Ü&q


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

linux½ø³ÌºÍÏß³Ì

ÕâÁ½ÌìÒ»Ö±ÔÚ¿´linxu½ø³ÌºÍÏ̵߳Ķ«Î÷£¬×ÜÊÇЧÂʱȽϵͣ¬Õâôһµã»ù´¡µÄ¶«Î÷»¹¿´ÁËÕâô¾Ã¡£¸Ã×ÔÎÒ·´Ê¡Ò»Ï¡£
Ê×ÏÈÀ´¿´¿´½ø³Ì¡£½ø³Ì·ÖΪÈý¸ö²¿·Ö£¬½ø³Ì¿ØÖƿ飬³ÌÐò¶ÎºÍÊý¾Ý¶Î¡£½ø³ÌÊÇÒ»¸öÓÐÉúÃüµÄʵÌ壬³ÌÐòÊÇÒ»¸öûÓÐÉúÃüµÄʵÌå¡£Ö»ÓÐCPU¸³Óè³ÌÐòÉúÃüµÄʱºò£¬³ÌÐò²Å³ÉΪһ¸ö»î¶¯µÄʵÌ壬ÎÒÃdzÆÖ®Îª“½ø³Ì”¡£Ã¿ ......

¹¹½¨ARM Linux½»²æ±àÒ빤¾ßÁ´ Ïê½â

  ¹¹½¨ARM Linux½»²æ±àÒ빤¾ßÁ´ Ïê½â
±¾ÕÂѧϰĿ±ê£º
  ¡ñ Á˽⽻²æ±àÒ빤¾ßÁ´
  ¡ñ Àí½â·Ö²½¹¹½¨½»²æ±àÒ빤¾ßÁ´µÄ·½·¨
  ¡ñ ѧ»áʹÓÃCrosstool¹¤¾ß¹¹½¨½»²æ±àÒ빤¾ßÁ´
2.1  ½»²æ±àÒ빤¾ßÁ´½éÉÜ
¶ÁÕß¿ÉÄÜ»áÓÐÒÉÎÊ£¬ÎªÊ²Ã´ÒªÓý»²æ±àÒëÆ÷£¿½»²æ±àÒëͨË׵ؽ²¾ÍÊÇÔÚÒ»ÖÖÆ ......

Linux 5.3ÏÂÅäÖÃnis+nfs+autofs


Linux 5.3ÏÂÅäÖÃnis+nfs+autofs
Server(·þÎñ¶Ë):ÏÈ×°ÉÏypserv·þÎñ¶ËÈí¼þ°ü # yum -y install ypserv*
# service ypserv start 
# chkconfig ypserv on
# authconfig-tui Í¼ÐγÌÐòÏÂÅäÖÃnisÓòÃûºÍ·þÎñ¶ËµØÖ·
# service ypserv ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ