linux Ïß³ÌÎÊÌâ - C/C++ / CÓïÑÔ
ÎÒÓà pthread_create ´´½¨Ò»¸öỊ̈߳¬»ñµÃÏØ³ÇµÄid;
idÊÇÈ«¾Ö±äÁ¿£¬ÎÒÏëÖÐÆäËûº¯ÊýÖÐÏû³ýÕâ¸öº¯Êý£¬ÇëÎÊÓ¦¸ÃÔõô×ö£¿
×îºÃÁгöÀý×Ó£¬Ð»Ð»¡£
û¿´Ã÷°×°¡....
void main()
{
pthread_t id;
_create(); //´´½¨Ïß³Ì
_del(); //ÈçºÎÔÚÕâÀï°ÑÏß³ÌÏûÃð£¿
}
_create()
{
pthread_create(&id,NULL...)
}
_del()
{
//????????????
}
int pthread_cancel (pthread_t thread);
Cancels the specified thread.
pthread_cancel º¯ÊýÖ»ÊÇÌá³öÒ»¸öÕâÑùµÄÇëÇ󣬵«²»Ò»¶¨ÄÜÖÕÖ¹Ị̈߳¬×îºÃÊÇÔÚÔÀ´µÄÏß³ÌÀïÃæ¸ã¸öÍ˳öÌõ¼þ
while(_run){
}
//ÆäËûÏß³Ì
//ÏȲ»¿¼ÂÇͬ²½ÎÊÌâ
_run = 0;
In the default circumstances, pthread_cancel will cause the thread specified by tid to behave as if it had called pthread_exit with an argument of PTHREAD_CANCELED. However, a thread can elect to ignore or otherwise control how it is canceled. Note that pthread_cancel doesn 't wait for the thread to terminate. It merely makes &
Ïà¹ØÎÊ´ð£º
ÓÐÒ»10*10¾ØÕ󣬳ýÈ¥µÚÒ»¸öµã£¨0£¬0£©ºÍ×îºóÒ»µã£¨9£¬9£©£¬»¹Óа˸öµãΪ1£¬ÆäËû¶¼Îª0£¬ÒªÇóÓöþάÊý×é±íʾ¡£°Ë¸öµãÊÇËæ»úÉú³ÉµÄ£¬±àдÏà¹Ø³ÌÐò±íʾ¾ØÕóËùÓпÉÄÜÇé¿ö¡£
ÕæÐÄÇó½Ì¸÷λ¸ßÊÖ£¬°¥£¡±¾ÈËÌ«²ËÁË£¡ºÇºÇ£¡
......
ÔÚ¸ùĿ¼/libÖдæ·ÅÒ»¸ölog.c£¬log.h£¬²¢ÓÃÏÂÃæµÄÓï¾ä£º
gcc -c log.c
ar crv liblog.a log.o
±àÒë³öÒ»¸öliblog.a¾²Ì¬¿â£¬È»ºóÔÚÎļþ¼Ð£º/testfileÖд´½¨Ò»¸ötest.cºÍtestc.c£¬test.cÖÐÒýÓÃÁËtestc.cÖж¨ÒåµÄ·½·¨ ......
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎͼ¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
ËÄܰïÎÒ°ÑÏÂÃæÕâЩ´úÂë¸Ä³ÉVBÐÎʽµÄ£¬¶àлÁË£¬¼±ÓÃ~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[],float g ......
visual c++2008Ëٳɰ棬²»ÄܱàÒëC³ÌÐòÂð£¿Èç¹ûÄÜÊÇÔõô¿ªÊ¼µÄ°¡£¿ÓÃËü´øµÄÃüÁîÌáʾµ¥Ôª³ýÍâ ¡£
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆÌ¨£©
¾ø¶Ô¿ÉÒÔ¡£½¨Á¢win32¿ØÖÆÌ¨³ÌÐò¾Í¿ÉÒÔ
ÒýÓÃ
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆÌ¨£ ......