Examples

合集下载

examples(总)

examples(总)

使用Win32线程API1线程创建实例1#include "stdafx.h"#include <windows.h>#include <iostream>using namespace std;DWORD WINAPI FunOne(LPVOID param){while(1){Sleep(1000);cout<<"This is FunOne "<<endl;}return 1;}DWORD WINAPI FunTwo(LPVOID param){while(1){Sleep(1000);cout<<"This is FunTwo "<<endl;}return 1;}int main(int argc, char* argv[]){DWORD lp1=0,lp2=0;HANDLE hand1=CreateThread (NULL, 0, FunOne, NULL, CREATE_SUSPENDED, &lp1); HANDLE hand2=CreateThread (NULL, 0, FunTwo, NULL, CREATE_SUSPENDED, &lp2); system("pause");ResumeThread(hand1);ResumeThread(hand2);system("pause");return 0;}2线程创建实例 2#include "stdafx.h"#include <windows.h>#include <process.h>#include <iostream>#include <fstream>using namespace std;void ThreadFunc1(PVOID param){Sleep(10000);cout<<"This is ThreadFunc1"<<endl;}void ThreadFunc2(PVOID param){Sleep(10000);cout<<"This is ThreadFunc2"<<endl;}void ThreadFunc3(PVOID param){Sleep(10000);cout<<"This is ThreadFunc2"<<endl;}int main(){int i=0;_beginthread(ThreadFunc1,0,NULL);_beginthread(ThreadFunc2,0,NULL);Sleep(3000);cout<<"end"<<endl;return 0;}3线程管理实例#include "stdafx.h"#include <windows.h>#include <iostream>using namespace std;DWORD WINAPI FunOne(LPVOID param){while(true){Sleep(1000);cout<<"hello! ";}return 0;}DWORD WINAPI FunTwo(LPVOID param){while(true){Sleep(1000);cout<<"world! ";}return 0;}int main(int argc, char* argv[]){int input=0;DWORD lp1=0,lp2=0;HANDLE hand1=CreateThread (NULL, 0, FunOne, (void*)&input, CREATE_SUSPENDED, &lp1); HANDLE hand2=CreateThread (NULL, 0, FunTwo, (void*)&input, CREATE_SUSPENDED, &lp2); while(true){cin>>input;if(input==1){ResumeThread(hand1);ResumeThread(hand2);}if(input==2){SuspendThread(hand1);SuspendThread(hand2);}if(input==0){TerminateThread(hand1,1);TerminateThread(hand2,1);}if(input==9)return 0;};return 0;}4同步——全局变量#include "stdafx.h"#include <windows.h>#include <iostream>using namespace std;int globalvar = false;DWORD WINAPI ThreadFunc(LPVOID pParam){cout<<"ThreadFunc"<<endl;Sleep(200);globalvar = true;return 0;}int main(){HANDLE hthread = CreateThread(NULL, 0, ThreadFunc, NULL, 0, NULL);if (!hthread){cout<<"Thread Create Error ! "<<endl;CloseHandle(hthread);}while (!globalvar)cout<<"Thread while"<<endl;cout<<"Thread exit"<<endl;return 0;}5事件机制应用实例#include "stdafx.h"#include <windows.h>#include <process.h>#include <iostream>#include <fstream>using namespace std;HANDLE evRead, evFinish;void ReadThread(LPVOID param){WaitForSingleObject (evRead ,INFINITE);cout<<"Reading"<<endl;SetEvent (evFinish);}void WriteThread(LPVOID param){cout<<"Writing"<<endl;SetEvent (evRead);}int main(int argc , char * argv[]){evRead = CreateEvent (NULL ,FALSE ,FALSE ,NULL) ;evFinish = CreateEvent (NULL ,FALSE ,FALSE ,NULL) ;_beginthread(ReadThread , 0 , NULL) ;_beginthread(WriteThread , 0 , NULL) ;WaitForSingleObject (evFinish,INFINITE) ;cout<<"The Program is End"<<endl;return 0 ;}6临界区同步机制实例#include "stdafx.h"#include <windows.h>#include <process.h>#include <iostream>#include <fstream>using namespace std;int total = 100 ;HANDLE evFin[2] ;CRITICAL_SECTION cs ;void WithdrawThread1(LPVOID param){EnterCriticalSection(&cs) ;if ( total-90 >= 0){total -= 90 ;cout<<"You withdraw 90"<<endl;}elsecout<<"You do not have that much money"<<endl;LeaveCriticalSection(&cs) ;SetEvent (evFin[0]) ;}void WithdrawThread2(LPVOID param){EnterCriticalSection(&cs) ;if ( total-20 >= 0){total -= 20 ;cout<<"You withdraw 20"<<endl;}elsecout<<"You do not have that much money"<<endl;LeaveCriticalSection(&cs) ;SetEvent (evFin[1]) ;}int main(int argc , char * argv[]){evFin[0] = CreateEvent (NULL,FALSE,FALSE,NULL) ;evFin[1] = CreateEvent (NULL,FALSE,FALSE,NULL) ;InitializeCriticalSection(&cs) ;_beginthread(WithdrawThread1 , 0 , NULL) ;_beginthread(WithdrawThread2 , 0 , NULL) ;WaitForMultipleObjects(2 ,evFin ,TRUE ,INFINITE) ;DeleteCriticalSection(&cs) ;cout<<total<<endl;return 0 ;}7互斥量同步机制实例#include "stdafx.h"#include <windows.h>#include <iostream>#define THREAD_INSTANCE_NUMBER 3using namespace std;LONG g_fResourceInUse = FALSE;LONG g_lCounter = 0;DWORD ThreadProc(void * pData) {int ThreadNumberTemp = (*(int*) pData);HANDLE hMutex;if ((hMutex = OpenMutex(MUTEX_ALL_ACCESS, FALSE, "Mutex.Test")) == NULL) { cout << "Open Mutex error!" << endl;}WaitForSingleObject( hMutex, INFINITE);cout<< "ThreadProc: " << ThreadNumberTemp << " is running!" << endl;cout << "ThreadProc " << ThreadNumberTemp << " gets the mutex"<< endl;ReleaseMutex(hMutex);CloseHandle(hMutex);return 0;}int main(int argc, char* argv[]){int i;DWORD ID[THREAD_INSTANCE_NUMBER];HANDLE h[THREAD_INSTANCE_NUMBER];HANDLE hMutex;if ( (hMutex = OpenMutex(MUTEX_ALL_ACCESS, FALSE, "Mutex.Test")) == NULL) { if ((hMutex = CreateMutex(NULL, FALSE, "Mutex.Test")) == NULL ) { cout << "Create Mutex error!" << endl;return 0;}}for (i=0;i<THREAD_INSTANCE_NUMBER;i++){WaitForSingleObject( hMutex, INFINITE);h[i] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) ThreadProc, (void *)&ID[i],0,&(ID[i]));if (h[i] == NULL)cout << "CreateThread error" << ID[i] << endl;elsecout << "CreateThread: " << ID[i] << endl;ReleaseMutex(hMutex);}WaitForMultipleObjects(THREAD_INSTANCE_NUMBER,h,TRUE,INFINITE);cout << "Close the Mutex Handle! " << endl;CloseHandle(hMutex);system("pause");return 0;}8信号量同步机制实例1#include"stdafx.h"#include<windows.h>#include<iostream>using namespace std;#define THREAD_INSTANCE_NUMBER 3DWORD foo(void * pData) {int ThreadNumberTemp = (*(int*) pData);HANDLE hSemaphore;if ((hSemaphore = OpenSemaphore(SEMAPHORE_ALL_ACCESS, FALSE, "Semaphore.Test")) == NULL) {cout << "Open Semaphore error!" << endl;}WaitForSingleObject(hSemaphore, // handle to semaphoreINFINITE); // zero-second time-out intervalcout << "foo: " << ThreadNumberTemp << " is running!" << endl;cout << "foo " << ThreadNumberTemp << " gets the semaphore"<< endl;ReleaseSemaphore(hSemaphore, 1, NULL);CloseHandle(hSemaphore);return 0;}int main(int argc, char* argv[]){int i;DWORD ThreadID[THREAD_INSTANCE_NUMBER];HANDLE hThread[THREAD_INSTANCE_NUMBER];HANDLE hSemaphore;if ((hSemaphore = CreateSemaphore(NULL,1,1, "Semaphore.Test")) == NULL ) { cout << "Create Semaphore error!" << endl;return 0;}for (i=0;i<THREAD_INSTANCE_NUMBER;i++){WaitForSingleObject(hSemaphore, // handle to semaphoreINFINITE); // zero-second time-out intervalhThread[i] = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE) foo,(void *)&ThreadID[i],0,&(ThreadID[i]));if (hThread[i] == NULL)cout << "CreateThread error" << ThreadID[i] << endl;elsecout << "CreateThread: " << ThreadID[i] << endl;ReleaseSemaphore(hSemaphore, 1, NULL);}WaitForMultipleObjects(THREAD_INSTANCE_NUMBER,hThread,TRUE,INFINITE);cout << "Close the Semaphore Handle! " << endl;CloseHandle(hSemaphore);system("pause");return 0;}信号量同步机制实例2#include"stdafx.h"#include<windows.h>#include<iostream>using namespace std;int seats=9;CRITICAL_SECTION cs ;#define THREAD_INSTANCE_NUMBER 50DWORD foo(void * pData) {int ThreadNumberTemp = (*(int*) pData);HANDLE hSemaphore;if ((hSemaphore = OpenSemaphore(SEMAPHORE_ALL_ACCESS, FALSE, "Semaphore.Test")) == NULL) {cout << "Open Semaphore error!" << endl;}WaitForSingleObject(hSemaphore, // handle to semaphoreINFINITE); // zero-second time-out intervalEnterCriticalSection(&cs) ;seats--;cout << seats<<endl ;LeaveCriticalSection(&cs) ;Sleep(2060);EnterCriticalSection(&cs) ;seats++;cout << seats <<endl;LeaveCriticalSection(&cs) ;ReleaseSemaphore(hSemaphore, 1, NULL);CloseHandle(hSemaphore);return 0;}int main(int argc, char* argv[]){int i;DWORD ThreadID[THREAD_INSTANCE_NUMBER];HANDLE hThread[THREAD_INSTANCE_NUMBER];HANDLE hSemaphore;if ((hSemaphore = CreateSemaphore(NULL,9,9, "Semaphore.Test")) == NULL ) { cout << "Create Semaphore error!" << endl;return 0;}InitializeCriticalSection(&cs) ;for (i=0;i<THREAD_INSTANCE_NUMBER;i++){//WaitForSingleObject(// hSemaphore, // handle to semaphore// INFINITE); // zero-second time-out intervalhThread[i] = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE) foo,(void *)&ThreadID[i],0,&(ThreadID[i]));// if (hThread[i] == NULL)// cout << "CreateThread error" << ThreadID[i] << endl;// else// cout << "CreateThread: " << ThreadID[i] << endl;// ReleaseSemaphore(hSemaphore, 1, NULL);}WaitForMultipleObjects(THREAD_INSTANCE_NUMBER,hThread,TRUE,INFINITE);//cout << "Close the Semaphore Handle! " << endl;CloseHandle(hSemaphore);DeleteCriticalSection(&cs) ;system("pause");return 0;}MFC多线程程序设计(主要代码)#include"stdafx.h"#include"exa8.h"#include"MainFrm.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endifHANDLE g_hBusy;HWND hwnd;int k=0;long data1[] = {12,32,47,763,75,43,86,42};long data2[] = {432,68,36,84,47,73,732,46};long data3[] = {435,754,37,765,48,785,326,78};long data4[] = {54,76,93,457,456,34,94,50};/////////////////////////////////////////////////////////////////////////////// CMainFrameIMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)//{{AFX_MSG_MAP(CMainFrame)// NOTE - the ClassWizard will add and remove mapping macros here.// DO NOT EDIT what you see in these blocks of generated code !ON_WM_CREATE()//}}AFX_MSG_MAPEND_MESSAGE_MAP()static UINT indicators[] ={ID_SEPARATOR, // status line indicatorID_INDICATOR_CAPS,ID_INDICATOR_NUM,ID_INDICATOR_SCRL,};int QuickSort(long* Array, int iLow, int iHigh)//快速排序程序{ if(iLow >= iHigh)return 1;long pivot = Array[iLow];int iLowSaved = iLow;int iHighSaved = iHigh;int n=0;for (int m=1; m<100000000;m++ )n++;while (iLow < iHigh){while (Array[iHigh] >= pivot && iHigh > iLow)iHigh --;Array[iLow] = Array[iHigh];while (Array[iLow]< pivot && iLow < iHigh)iLow++;Array[iHigh] = Array[iLow];}Array[iLow] = pivot;QuickSort(Array,iLowSaved,iHigh-1);QuickSort(Array, iLow+1, iHighSaved);return 0;}UINT DataProcess(LPVOID p){ long* Array = (long*)p;char pszMsg[512];memset(pszMsg,'\0',512);DWORD dwRet;int i;QuickSort( Array, 0, 7);dwRet = WaitForSingleObject(g_hBusy, INFINITE) ;for(i=0; i<8; i++){ sprintf(pszMsg, "%d ", Array[i]);SendMessage(hwnd, EM_REPLACESEL, true, (LPARAM)(pszMsg));Sleep(100);}sprintf(pszMsg, "\r\n");SendMessage(hwnd, EM_REPLACESEL, true, (LPARAM)(pszMsg));ReleaseSemaphore(g_hBusy, 1, NULL);//给g_hBusy信号量加return 0;}// CMainFrame construction/destructionCMainFrame::CMainFrame(){// TODO: add member initialization code here}CMainFrame::~CMainFrame(){}int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct){if (CFrameWnd::OnCreate(lpCreateStruct) == -1)return -1;if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||!m_wndToolBar.LoadToolBar(IDR_MAINFRAME)){TRACE0("Failed to create toolbar\n");return -1; // fail to create}if (!m_wndStatusBar.Create(this) ||!m_wndStatusBar.SetIndicators(indicators,sizeof(indicators)/sizeof(UINT))){TRACE0("Failed to create status bar\n");return -1; // fail to create}// TODO: Delete these three lines if you don't want the toolbar to// be dockablem_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);EnableDocking(CBRS_ALIGN_ANY);DockControlBar(&m_wndToolBar);return 0;}BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs){if( !CFrameWnd::PreCreateWindow(cs) )return FALSE;// TODO: Modify the Window class or styles here by modifying// the CREATESTRUCT csreturn TRUE;}///////////////////////////////////////////////////////////////////////////// // CMainFrame diagnostics#ifdef _DEBUGvoid CMainFrame::AssertValid() const{CFrameWnd::AssertValid();}void CMainFrame::Dump(CDumpContext& dc) const{CFrameWnd::Dump(dc);}#endif//_DEBUG///////////////////////////////////////////////////////////////////////////// // CMainFrame message handlersvoid CMainFrame::Start(){g_hBusy = CreateSemaphore(NULL, 1, 1, NULL);hwnd=m_hwndViewEdit;AfxBeginThread(DataProcess, (LPVOID)data1, THREAD_PRIORITY_NORMAL);AfxBeginThread(DataProcess, (LPVOID)data2, THREAD_PRIORITY_NORMAL);AfxBeginThread(DataProcess, (LPVOID)data3, THREAD_PRIORITY_NORMAL);AfxBeginThread(DataProcess, (LPVOID)data4, THREAD_PRIORITY_NORMAL);}.NET框架下创建线程实例using System;using System.Threading;class Test{static void Main(){ThreadStart threadDelegate = new ThreadStart(Work.DoWork);Thread newThread = new Thread(threadDelegate);newThread.Start();Work w = new Work();w.Data = 42;threadDelegate = new ThreadStart(w.DoMoreWork);newThread = new Thread(threadDelegate);newThread.Start();Console.Read();}}class Work{public static void DoWork(){Console.WriteLine("Static thread procedure.");}public int Data;public void DoMoreWork(){for (int i = 1; i <= 500000000; i++){Data++;}Console.WriteLine("Instance thread procedure. Data={0}", Data);}}.NET框架下同步机制using System;using System.Threading;class Test{static private Object thisLock = new Object();static int total = 100,m=0;public static void WithDraw1(){int n=90;lock (thisLock){if (n <= total){for (int i = 0; i < 200000000; i++)m++;total -= n;Console.WriteLine("You have withdrawn. n={0}", n);Console.WriteLine("total={0}", total);}else{Console.WriteLine("You do not enough money. n={0}", n);Console.WriteLine("total={0}", total);}}}public static void WithDraw2(){int n = 20;lock (thisLock){if (n <= total){for (int i = 0; i < 200000000; i++)m++;total -= n;Console.WriteLine("You have withdrawn. n={0}", n);Console.WriteLine("total={0}", total);}else{Console.WriteLine("You do not enough money. n={0}", n);Console.WriteLine("total={0}", total);}}}public static void Main(){ThreadStart thread1 = new ThreadStart(WithDraw1);Thread newThread1 = new Thread(thread1);ThreadStart thread2 = new ThreadStart(WithDraw2);Thread newThread2 = new Thread(thread2);newThread1.Start();newThread2.Start();Console.Read();}}Linux多线程编程1、基本线程操作#include<stdio.h>#include<stdlib.h>#include<unistd.h>#include<pthread.h>#define THREAD_NUMBER 2int retval_hello1= 2, retval_hello2 = 3;void* hello1(void *arg){char *hello_str = (char *)arg;sleep(1);printf("%s\n", hello_str);pthread_exit(&retval_hello1);}void* hello2(void *arg){char *hello_str = (char *)arg;sleep(2);printf("%s\n", hello_str);pthread_exit(&retval_hello2);}int main(int argc, char *argv[]){int i;int ret_val;int *retval_hello[2];pthread_t pt[THREAD_NUMBER];const char *arg[THREAD_NUMBER];arg[0] = "hello world from thread1";arg[1] = "hello world from thread2";printf("Begin to create threads...\n");ret_val = pthread_create(&pt[0], NULL, hello1, (void *)arg[0]);if (ret_val != 0 ) {printf("pthread_create error!\n");exit(1);}ret_val = pthread_create(&pt[1], NULL, hello2, (void *)arg[1]);if (ret_val != 0 ) {printf("pthread_create error!\n");exit(1);}printf("Begin to wait for threads...\n");for(i = 0; i < THREAD_NUMBER; i++) {ret_val = pthread_join(pt[i], (void **)&retval_hello[i]);if (ret_val != 0) {printf("pthread_join error!\n");exit(1);} else {printf("return value is %d\n", *retval_hello[i]);}}printf("Now, the main thread returns.\n");return 0;}2、线程属性操作#include<stdio.h>#include<stdlib.h>#include<pthread.h>void* sum_val(void *arg){int sum = 0;int i;int count = *(int *)arg;for (i = 0; i < count; i++)sum = sum + i;printf("sum is %d\n", sum);pthread_exit(0);}int main(int argc, char *argv[]){pthread_t pt;int count = 10;int ret_val;pthread_attr_t attr;struct sched_param sp;sp.__sched_priority = 2;ret_val = pthread_attr_init(&attr);if (ret_val != 0) {printf("pthread_attr_init error!\n");exit(1);}ret_val = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);if (ret_val != 0) {printf("pthread_attr_setdetachstate error!\n");exit(1);}ret_val = pthread_attr_setschedpolicy(&attr, SCHED_RR);if (ret_val != 0) {printf("pthread_attr_setschedpolicy error!\n");exit(1);}ret_val = pthread_attr_setschedparam(&attr, &sp);if (ret_val != 0) {printf("pthread_attr_setschedparam error!\n");exit(1);}ret_val = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);if (ret_val != 0) {printf("pthread_attr_setinheritsched error!\n");exit(1);}ret_val = pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);if (ret_val != 0) {printf("pthread_attr_setscope error!\n");exit(1);}ret_val = pthread_create(&pt, NULL, sum_val, (void *)&count);if (ret_val != 0 ) {printf("pthread_create error!\n");exit(1);}pthread_attr_destroy(&attr);sleep(5);return 0;}3、使用mutex实例#include<stdio.h>#include<stdlib.h>#include<pthread.h>#include<errno.h>#define THREAD_NUMBER 10static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;int sum =0;void* inc(void *arg){int i =(*(int *)arg);pthread_mutex_lock(&mutex);sum = sum +i;pthread_mutex_unlock(&mutex);return NULL;}int main(int argc, char *argv[]){pthread_t pt[THREAD_NUMBER];int i;int arg[THREAD_NUMBER];for(i=0; i<THREAD_NUMBER; i++) {arg[i]=i;if(pthread_create(&pt[i], NULL, inc, (void *)&arg[i])!=0){ printf("pthread_create error\n");exit(1);}}for(i=0; i<THREAD_NUMBER; i++)if(pthread_join(pt[i],NULL)!=0){printf("pthread_join error\n");exit(1);}printf("sum is %d\n",sum);pthread_mutex_destroy(&mutex);return 0;}4、使用条件变量实例#include<stdio.h>#include<stdlib.h>#include<unistd.h>#include<pthread.h>#define THREAD_NUMBER 2static pthread_cond_t cond = PTHREAD_COND_INITIALIZER; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;void* thread1(void *arg){pthread_mutex_lock(&mutex);printf("thread1 locked the mutex\n");printf("thread1 is waiting for condition signal...\n"); pthread_cond_wait(&cond, &mutex);printf("thread1 received condition signal!\n");pthread_mutex_unlock(&mutex);printf("thread1 unlocked the mutex\n");pthread_exit(0);}void* thread2(void *arg){int i = 0;struct timeval old, new;gettimeofday(&old);new = old;pthread_mutex_lock(&mutex);printf("thread2 locked the mutex\n");while (_sec - _sec < 5) {sleep(1);gettimeofday(&new);i++;printf("thread2 sleep %d seconds\n", i);}printf("thread1 calls pthread_cond_signal...\n");pthread_cond_signal(&cond);pthread_mutex_unlock(&mutex);printf("thread2 unlocked the mutex\n");pthread_exit(0);}int main(int argc, char *argv[]){int i;int ret_val;pthread_t pt[THREAD_NUMBER];ret_val = pthread_create(&pt[0], NULL, thread1, NULL);if (ret_val != 0 ) {printf("pthread_create error!\n");exit(1);}ret_val = pthread_create(&pt[1], NULL, thread2, NULL);if (ret_val != 0 ) {printf("pthread_create error!\n");exit(1);}for (i = 0; i < THREAD_NUMBER; i++) {ret_val = pthread_join(pt[i], NULL);if (ret_val != 0) {printf("pthread_join error!\n");exit(1);}}pthread_mutex_destroy(&mutex);pthread_cond_destroy(&cond);return 0;}5、使用等待时间限制的条件变量的实例#include<stdio.h>#include<stdlib.h>#include<unistd.h>#include<time.h>#include<pthread.h>#include<errno.h>#define THREAD_NUMBER 2static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;static int x = 0, y = 0;void* thread1(void *arg){struct timeval now;struct timespec timeout;int retcode;pthread_mutex_lock(&mutex);gettimeofday(&now, NULL);_sec = _sec + 5;_nsec = _usec * 1000;retcode = 0;while (x >= y && retcode != ETIMEDOUT) {retcode = pthread_cond_timedwait(&cond, &mutex, &timeout); }if (retcode == ETIMEDOUT) {printf("pthread_cond_timedwait timeout!\n");} else {printf("thread1 got condition signal!\n");}pthread_mutex_unlock(&mutex);pthread_exit(0);}void* thread2(void *arg){int i;for (i = 0; i < 5; i++) {x = rand() % 5;y = rand() % 5;sleep(1);printf("x is %d, y is %d\n", x ,y);if ( x < y)break;}pthread_mutex_lock(&mutex);if (x < y) {pthread_cond_broadcast(&cond);}pthread_mutex_unlock(&mutex);pthread_exit(0);}int main(int argc, char *argv[]){int i;int ret_val;pthread_t pt[THREAD_NUMBER];ret_val = pthread_create(&pt[0], NULL, thread1, NULL);if (ret_val != 0 ) {printf("pthread_create error!\n");exit(1);}ret_val = pthread_create(&pt[1], NULL, thread2, NULL);if (ret_val != 0 ) {printf("pthread_create error!\n");exit(1);}for (i = 0; i < THREAD_NUMBER; i++) {ret_val = pthread_join(pt[i], NULL);if (ret_val != 0) {printf("pthread_join error!\n");exit(1);}}pthread_mutex_destroy(&mutex);pthread_cond_destroy(&cond);return 0;}OpenMP编程实例1、简单并行区域编程#include "stdafx.h"#include "omp.h"int _tmain(int argc, _TCHAR* argv[]){printf("Hello from serial.\n");printf("Thread number = %d\n",omp_get_thread_num()); //串行执行#pragma omp parallel //开始并行执行{printf("Hello from parallel. Thread number=%d\n",omp_get_thread_num());}printf("Hello from serial again.\n");return 0;}2、数据相关程序实例#include"stdafx.h"#include"omp.h"#include"windows.h"#include<stdlib.h>int x[100],y[100],k;int _tmain(int argc, _TCHAR* argv[]){x[0] = 0;y[0] = 1;//#pragma omp parallel for private(k)for (k = 1; k < 100; k++){x[k] = y[k-1] + 1; //S1y[k] = x[k-1] + 2; //S2}printf("y=%d\n",y[99]);printf("x=%d\n",x[99]);return 0;}3、#include"stdafx.h"#include"omp.h"#include"windows.h"#include<stdlib.h>int x[100],y[100],k,m;int _tmain(int argc, _TCHAR* argv[]){x[0] = 0;y[0] = 1;x[49] = 74;y[49] = 74 ;//#pragma omp parallel for private(k)#pragma omp parallel for private(m, k)for (m = 0; m < 2; m++){for (k = m*49 + 1; k < m*50 + 50; k++){x[k] = y[k-1] + 1; //S1y[k] = x[k-1] + 2; //S2}}printf("y=%d\n",y[99]);printf("x=%d\n",x[99]);return 0;}4、循环嵌套#include"stdafx.h"#include"omp.h"int _tmain(int argc, _TCHAR* argv[]){int i;int j;#pragma omp parallel for//#pragma omp parallel for private(j)for(i=0;i<4;i++)for(j=6;j<10;j++)printf("i=%d j=%d\n",i,j);printf("######################\n");for(i=0;i<4;i++)#pragma omp parallel forfor(j=6;j<10;j++)printf("i=%d j=%d\n",i,j);return 0;}5控制数据的共享属性——私有变量的初始化和终结操作实例#include "stdafx.h"#include "omp.h"#include "windows.h"int _tmain(int argc, _TCHAR* argv[]){int val=8;#pragma omp parallel for firstprivate(val) lastprivate(val)for(int i=0;i<2;i++){printf("i=%d val=%d\n",i,val);if(i==1)val=10000;printf("i=%d val=%d\n",i,val);}printf("val=%d\n",val);return 0;}6 并行区域编程#include "stdafx.h"#include "windows.h"#include "omp.h"int _tmain(int argc, _TCHAR* argv[]){printf("first execution.\n");#pragma omp parallelfor(int i=0;i<5;i++)printf("hello world i=%d\n",i);printf("second exectuion.\n");#pragma omp parallel forfor(int i=0;i<5;i++)printf("hello world i=%d\n",i);return 0;}7 数据竞争#include "stdafx.h"#include "windows.h"#include "omp.h"。

Literary term文学术语

Literary term文学术语

Synecdoche
[sɪ'nekdəki] n.提喻法 Examples: • There are about 100 hands workin g in his factory. • He is the Newton of this century. • The fox goes very well with your c ap.

In the mid-18th century, a new literary movement called romanticism came to Europe and then to England. • It was characterized by a strong protest against the bondage of neoclassicism, which emphasized reason, order and elegant wit. Instead, romanticism gave primary concern to passion, emotion, and natural beauty. • In the history of literature. Romanticism is generally regarded as the thought that designates a literary and philosophical theory which tends to see the individual as the very center of all life and experience. The English romantic period is an age of poetry which prevailed in England from 1798 to 1837. The major romantic poets include Wordsworth, Byron and Shelley.

新SAT写作证据(Evidence)分析解读之Example(例证)— 李盛

新SAT写作证据(Evidence)分析解读之Example(例证)— 李盛

新SAT写作证据(Evidence)分析解读之Example(例证)新东方在线SAT教研组李盛在议论文写作中,Example(例子)是经常使用的一种论证形式。

作者往往会给读者呈现具体的细节,从而证明自己观点的正确性。

请阅读下面从文章中节选的段落:The rest of the world depends on darkness as well, including nocturnal and crepuscular species of birds, insects, mammals, fish and reptiles. Some examples are well known—the 400 species of birds that migrate at night in North America, the sea turtles that come ashore to lay their eggs—and some are not, such as the bats that save American farmers billions in pest control and the moths that pollinate 80% of the world’s flora. Ecological light pollution is like the bulldozer of the night, wrecking habitat and disrupting ecosystems several billion years in the making. S imply put, without darkness, Earth’s ecology would collapse . . . .在上面这段话中,为了说明黑暗对于动物的重要性,作者列举了若干个例子:Some examples are well known—the 400 species of birds that migrate at night in North America, the sea turtles that come ashore to lay their eggs—and some are not, such as the bats that save American farmers billions in pest control and the moths that pollinate 80% of the world’s flora.这里,作者通过几个例子说明了各种动物是如何依赖黑暗生存及在生物圈做出贡献的。

高三英语字谜Unit 04-Examples

高三英语字谜Unit 04-Examples

Unit 04, Senior IIIExamplesACROSS4 n£®Its tariffs cater for four basic _______s of customer.Hotels within this _______ offer only basic facilities.5 adv£®When Artie stopped calling ________, Julie found a new man...I don't ________ agree with you.Many commuters havestopped using their cars ________.9 n£®Early _________ of a disease can prevent death and illness...The _________ of a problem is the first step toward solving it.11 vt£®It made sense to ______ a banker to this job...They have ______ed Smith/a new manager.We need to _______ a newtreasurer.12 n£®It was not a fortune but would help to cover household _______s.He hired a plane, regardless of _______.You can claim partof your telephone bill as a business _______.15 vt£®You don't have to sacrifice environmental protection to _______ economic growth...She worked hard and was soon_______d.A college course can help you find work or get _______d.17 n£®...a bunch of yellow ____s.I found him pruning his ____s.a ____ garden18 n£®...a bottle of lemonade with a _____ in it.a stable filled with _____bales of _____19 n£®...oranges, ______s and other citrus fruits.Add the juice of half a ______.21 vt.If there was a cover-up, it I______d people at the very highest levels of government.The strike ______d many people.Thecourse ______s a great deal of hard work.23 vt£®We ______ that the average size farm in Lancaster County is 65 acres..._______ the cost of sth/how much sth will costWe'llneed to _______ the overall costs.25 n£®Economic reform has brought relative ______ to peasant farmers...Nobody knew how she had acquired her ______.Theyused some of their _______ to build magnificent town halls.26 n£®Sage, mint and dill are all ____s.27 adv£®This kind of forest exists _______ else in the world...`Where are you going at the weekend?' `_______ special_______ onearth is free from ecological damage.28 n£®29 n£®Most of the demonstrators were white and ____.a ____ horse, human, bird____ colleagues/counterparts/workers34 n£®A biopsy is usually a minor surgical _______...Registering a birth or death is a straightforward _______.Companies use avariety of testing _______s to select appropriate candidates.35 n£®They are not optimistic about a ______ of the eleven year conflict.the ______ of a debt, dispute, claimThey are negotiating apeace ______.37 n£®Government statistics show the largest drop in industrial ______ for ten years.The average ______ of the factory is 20 cars aday.Industrial ______ increased by four percent last year.DOWN1 vi.&vt.Could he ________ right from wrong?...People who cannot ________ between colours are said to be colour-blind.Helearned to _________ a great variety of birds, animals, and plants.2 n£®¡-_______ies and cream.fresh _______ies and creama bowl of _______ies and ice cream.3 n£®...a laboratory _______.a laboratory/dental _______6 n£®There are plenty of small industrial ________s.his latest business _________Euro Disney is a much smaller ________ thanits American counterparts.7 vt£®Lead can _______ in the body until toxic levels are reached._______ enough evidence to ensure his convictionOver theyears, I had _______d hundreds of books.8 n£®10 adj.The area is of great _______ interest._________ research11 n£®She used to be so fussy about her ________¡-Fine clothes added to his strikingly handsome ________.His thinning hairgave him the ________ of a much older man.13 n£®fresh/tinned _______14 adj£®Downstairs there's a breakfast room and guests can relax in the ____ bar.a ____ room, chair, feeling16 n£®The Russian Federation has issued a decree abolishing special _______s for government officials.Parking in this street is the________ of the residents.Cheap air travel is one of the _______s of working for the airline.20 adv£®They are offering ______ technical assistance.This job is ______ a way to pay my bills.22 vt£®The road is strewn with _______ed vehicles.a baby _______ed by its parentsHis mother _______ed him when he was fivedays old.23 vt.It is necessary initially to _______ the headaches into certain types...The books in the library are ______ied by/according tosubject.In the study families are ______ied according to their incomes.24 n£®Cross could hear him speaking in low ____s to Sarah.the ringing ____s of an orator's voiceMeredith trembled at thetenderness in his ____.30 n£®He has a healthy _______...When I was ill I completely lost my _______.a chubby baby with a good, healthy _______31 n£®He had left a huge _____ of flowers in her hotel room.a _____ of bananas, grapes, etcA _______ of flowers that someonehas arranged in an attractive way is called a bouquet.32 n£®...a black bird with a yellow ____.33 n£®He was given the job as a ______ for running a successful leadership bid.work without hope of ____________s forappropriate behavior can be successful in teaching children.36 adj£®He tracked down his cousin and uncle. The _____ was sick.Many support the former alternative, but personally I favour the______ (one).He did well in both schoolwork and sports and won a number of medals in the ______Abandon, accumulate, altogether, appearance, appetite, appoint, astronomy, beak,WORDS USED IN THIS PUZZLE:botanical, bunch, calculate, classification, classify, cosy, dandelion, distinguish, enterprise, expense, herb, identification,involve, latter, lemon, male, merely, nowhere, output, pineapple, privilege, procedure, promote, reward, rose, settlement,straw, strawberry, technician, tone, wealth.Unit 04, Senior IIIExamples。

example可数吗

example可数吗

example可数吗
“example”这个词在语法上通常被视作可数名词。

这意味着我们可以使用不定冠词“an”来修饰单数形式的“example”,如“an example”(一个例子),同时也可以在“example”后面加上复数形式的后缀“-s”,形成“examples”(例子们),来表示多个例子。

在实际使用中,我们可以根据需要选择合适的形式。

例如,当我们想要表达一个具体的、单一的例子时,可以使用单数形式的“example”;而当我们想要表达多个例子或者泛指例子时,可以使用复数形式的“examples”。

此外,值得注意的是,“example”这个词在语境中也可以用来泛指一种情况或行为,此时可能不需要特别区分单复数形式。

例如,在句子“This is an example of good behavior.”(这是一个好行为的例子。

)中,“example”泛指一种好行为的情况,而不是具体的一个或多个例子。

因此,在具体使用时需要根据语境来判断是否需要使用复数形式。

无机化学下册:Examples-Cu and Zn

无机化学下册:Examples-Cu and Zn

Examples:
1.为什么氯化亚汞的分子式要写成Hg2Cl2,而 不写成HgCl? 2.同属ds区元素,为什么铜族易形成+2、+3化 合态,而锌族不能形成+3化合态? 3.为什么Cu(I)能稳定存在于固态化合物中,却 在水溶液中不稳定?但在Cu2+的溶液中加入I却能生成CuI沉淀? 4.铜族元素的离子和锌族元素的离子均为18e 构型,既无成单电子也无d-d跃迁,但为何Cd 和Hg的某些化合物常有较深的颜色,而AgX按 Cl, Br, I的次序颜色越来越深?
5.锌是生物体最重要的微量元素之一,ZnCO3 和ZnO也可作为药膏促进伤口的愈合,为什 么在炼锌厂附近却存在较严重的污染?又为 何在治理含汞废水时先加入一定量的Na2S再 加入FeSO4? 6.分离并鉴别下列物质:(1)用三种不同的方法 区分Zn盐和Mg盐; (2)用两种不同的方法区 分Zn盐和Cd盐; (3)分离Zn2+、Cu2+;分离Zn2+、 Cd2+、Mg2+。
6. (1)利用氢氧化物的两性:Zn(OH)2溶于 过量碱而Mg(OH)2不溶;Zn2+和NH3生成 配合物,Mg2+不行;Zn2+在低酸度时可 和H2S反应生成ZnS,财Mg盐不与H2S反 应。 (2)ZnS为白色,CdS则为黄色;Zn(OH)2 为两性,Cd(OH)2不溶于过量碱。 (3)(a)二者均可生成硫化物沉淀,但CdS 溶于浓盐酸,CuS则不溶,以此分离二者。 (b) Cd2+和Zn2+生成CdS及ZnS和Mg2+分离, 再用稀盐酸溶解ZnS将其和CdS分离。
Return
2.铜族元素的(n-1)d和ns轨道能级差较小, 因而它们不仅可以失去s电子,还可失去 1-2个d电子而显+2和+3氧化态。而IIB族 则不同,它们的(n-1)d及ns轨道均达到了 全满,能级差较大,一般易失去s轨道上 的电子。同时Zn、Cd、Hg具较高的第三 电离能,而溶剂化能及晶格能都不足以 保持+3氧化态的化学稳定性。

writing--example


Rewrite the part

Physically impaired as she is, Sandy doesn't want to be treated as a deaf girl. Apparently, being cynical or making the most of her deafness was all because she wanted to be seen as an equally normal person. Sandy is not the only person to hold that expectaion. Liuwei, who lost his arms in an accident, played the piano wonderfully just with his feet in a recent Talent Show. What impressed the audience is not just his performance, but his strong belief. He said he was no different from other people and he could do what others did with their hands.

Boiling water is like the adversity in life. Sometimes it just seems as one problem was solved a new one arose. When facing such boiling water, are you a coffee bean? It means not merely crossing the difficult barriers with a strong will, but making the most of the misfortune and turning it into opportunities . Just like Sandy, she is undoubtedly a coffee bean, for she turned her disability into an opportunity to out stand and chase her true love.

英语常用句型(examples)

Waste Sorting1. 目前垃圾分类不是很普遍2. 忽视垃圾分类会带来哪些影响3. 我们应该…Waste sorting is not a popular convention in our country, though it should be. Garbage bins filled with all sorts of recyclable and non—recyclable wastes mixed together are seen everywhere. People stil l haven’ t formed the habit of sorting wastes.The neglect of waste sorting will bring about a series of problems. First of all, it causes a mass of waste of resources that could have been recycled or reused. Secondly, the growing amount of mixed rubbish will take up a lot of space in the landfill site, which will worsen the land shortage problem. Last but not least, it will increase the cost of waste treatment.Waste sorting should be advocated, no matter from the perspective of economy or environment. Everyone should do their best by starting from daily life. More importantly, more campaigns for waste sorting should be conducted to raise the public awareness.能力和外貌Abilities and Good Looks (能力和外貌)We are often told not to judge people by their appearance, because for a person, abilities are far more important than appearance. Throughout history, there are numerous examples of outstanding people with remarkable achievements who are just plain or not good-looking at all.However, nowadays some people hold the belief that appearance outweighs abilities, partly because some beautiful people seem to have advantages in competitive situations like job interviews and have been given more opportunities than others.Nevertheless, I still firmly believe that abilities are more important For one thing, although good looks are easy on the eye, it is always one’ s abilities that create values that really matter. For another, while people’ s good looks were born to them, abilities have to be gained through deliberate self-cultivation and years of hardworking which speak more of people’ s true colors. Last but not least, abilities grow over time while good looks only fade. Eventually,it is the abilities that help people succeed, so it is safe to say that abilities will always bring more to life than good looks.应对紧张Caught up in the rush of life, we have forgotten how to live and how to find simple things charming. Taking a walk at night under the stars provides something that business deals cannot provides; enjoying warm sunlight, birds' songs and flowers’ fragrance is not for poets only, but for everyone. Meditation, too, is a great need. Meditation brings understanding of life's relationships, purposes,objectives, and rewards, sharp focus. It is an aid for tense nerves. The only way to cope with tension is to learn how to manage one’s body and one’s mind. Resting includes time in bed as well as short periods of relaxation. One may relax when walking on the street, by flexing his muscles and diverting his mind to things around him. Moreover, enough time should be taken for a leisurely lunch. The most inefficient way of handing tiredness and pressure is to take stimulant or drugs.Everyone has only 24 hours a day, and a limited number of years to live. So we need to admitlimitations of physical and mental strength, and to keep within those limits.做义工1,现在有越来越多的人愿意做义工2,以上现象出现的原因3,义工应该具备哪些素质There is a growing tendency nowadays that people in mounting numbers show great enthusiasm for (对…显示出极大地热情)volunteer works. They are willing to do voluntary work in many fields varying from offering services in sports events to keeping passengers in line at the bus station and so forth.Ample reasons can account for this phenomenon. In the first place, with the development of people’s living standard,people should not necessarily be busy (不必要忙于)earning money to support their families.(养家)Instead, they can make better use of their spare time (更好地利用时间)by do something valuable and helpful to others, such as being a volunteer. In the second place, influenced by(受到影响)the education campaign launched by Chinese governments, Chinese people’s awareness of being a volunteer has been greatly st but not least, doing volunteer work is also a source of happiness and gratification (幸福感和满足感的来源)for most people.Being a volunteer is anything but (绝不是)an easy job. It is required that those who want to be a volunteer should possess a strong desire to help others and serve the society.It is unimaginable that (难以想象)those who lack love and a sense of responsibility can bring happiness to others and contribute to society.You should write a composition on the topic Turn off Your Mobile Phone. 1.移动电话给我们的生活带来了便利;2.移动电话有时也会影响别人,3.提出自己的想法。

科技论文标题中_以_为例_英译用词探讨_杨廷君

86 24 18 7 1 1 1 1 1 1 1 1
12 6 1 1 2 1 1 1
31
中国科技术语 /2015 年第 6 期
类别 第3 类 ( 24. 90% )
其他类 ( 7. 63% )
译文表达用词
a case from + NP a case of + NP a case in + NP a case for + NP case of + NP cases from + NP a case history of case research on + NP in the case of in a case of + NP the case of + NP with + NP + as the case a case history of + NP taking + NP + as a case taking + NP + as case taking NP as a case based on…cases
一 研究语料的基本数据
此次所提取的 474 篇学术论文,从时间分布上 看,出现逐年递增的趋势,见表 1。
表 1 论文的时间分布
时间 1997 年以前
1998 年 1999 年 2000 年 2001 年 2002 年 2003 年 2004 年 2005 年
论文数量 14 5 6 8 8 17 23 19 23
examples of + NP examples of + NP examples in + NP examples from + NP examபைடு நூலகம்le from example of

10 Examples

Examples (Exemplification, Illustration)
Question:
Talk about the impressions that the following two examples give you?
• E.G.1.The mayor is corrupt and should not be reelected. • E.G.2.The mayor should not be reelected because he has fired two city workers who refused to contribute to his campaign fund, put his family and friends on the city payroll, and used public employees to make improvements on his home.
3. Using Examples to Persuade
Eg. A statement in response to a question on an economics quiz that adequate health insurance is now out of reach for many Americans Can you give some example to make it more persuasive?
4. Using Examples to Test your point
• Examples can help you test your ideas as well as the ideas of others.
2 Look for transitional expressions that indicate illustration:
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Writers often use one or more examples to explain or illustrate their main idea. Topic sentence [In this century, the president is much more cut off from contact with the people than in earlier times.]Example [Ordinary citizens, for example, could get to see Abraham Lincoln directly in the White House and make their requests to him in person.] Some writers announce their strategy outright by the words for example or for instance. Other writers may include several examples without announcing them directly, and thereby expect the reader to notice that they are indeed specific examples.To make a clear case, the writer usually wants to give several examples, often to show several sides of an idea. The writer of the previous example might want to add an example about Jimmy Carter or Ronald Reagan and how they visited private citizens in their homes or invited them to special ceremonies. Or perhaps the writer might want to add an example of another type of president—how Nixon was hard to reach, even by his own staff.Examples are important and necessary. Sometimes, without concrete examples, the reader will have only a vague idea of what the writer’s topic sentence or thesis statement means. In the following paragraphs, notice how the examples illustrate and clarify the topic sentences.The American colonists used a variety of goods in place of money. These goods included beaver pelts, grain, musket balls, and nails. Some colonists, especially in the tobacco-growing colonies of Maryland and Virginia, circulated receipts for tobacco stored in warehouses. Indian wampum, which consisted of beads made from shells, was mainly used for keeping records. But Indians and colonists also accepted it as money.The colonists also used any foreign coins they could get. English shillings, Spanish dollars, and French and Dutch coins all circulated in the colonies. Probably the most common coins were large silver Spanish dollars called pieces of eight. To make change, a person could chop the coin into eight pie-shaped pieces called bits. Two bits were worth a quarter of a dollar, four bits a half dollar, and so on. We still use the expression two bits to mean a quarter of a dollar.Different ways in using examples:1. one example (one extended example)2. many examples3. a combination of the two strategiesWhen using examples in your own writing, brainstorm for possibilities and select those that illustrate your idea most accurately. In choosing among possibilities, favor those that you sense your reader will respond to as convincing and colorful. Several well-chosen examples will often hold your reader’s interest and add credibility to your main idea.A student’s workThere is a good example among Koreans which makes me feel proud of what people can accomplish despite hardship. Mr. and Mrs. Lee (no relation to us) had a son named Sammy. The first time I saw him, he was only eleven months old. I watched his progress all the way through the University of Southern California School of Medicine, where he became a doctor, specializing in ear, nose, and throat ailments. He was always playing in the swimming pools and became interested in high diving. The coach at USC took an interest in him and helped him to develop into an expert high-platform diver. Sammy Lee won the Olympic Gold medal for high-platform diving in 1948 and successfully defended hid title in 1952. In 1953 he became the first non-Caucasian to win the James E. Sullivan Memorial Trophy. His parents helped with all his expenses by working in their chop suey restaurant for many years.Two readings:The shoe as a strategic weaponAttempts to limit female mobility by hampering locomotion are ancient and almost universal. The foot-binding of upper-class Chinese girls and the Nigerian custom of loading women’s legs with pounds of brass wire are extreme examples, but all over the world similar stratagems have been employed to make sure that once you have caught a woman she cannot run away, even if she stays around she cannot keep up with you. What seems odd is that all these devices have been perceived as beautiful, not only by men but by women. The lotus foot, which seems to us a deformity, was passionately admired in China for centuries, and today most people in Western society see nothing ugly in the severely compressed toes produced by modern footwear. The high-heeled, narrow-toed shoes that for most of this century have been an essential part of women’s costume are considered sexually attractive, partly because they make the legs look longer –an extended leg as the biological sign of sexual availability in several animal species because they produce what anthropologists call a “courtship strut.” They also make standing for any length of time painful, walking exhausting and running impossible. The halting, tiptoe gait they produce is thought provocative—perhaps because it guarantees that no women wearing them can outrun a man who is chasing her. Worst of all, if they are worn continually from adolescence on, they deform the muscles of the feet and legs so that it becomes even more painful and difficult to walk in flat soles.Questions about the writer’s strategies:What is the topic sentence of the paragraph Where is it locatedDoes the writer use many examples, one extended example, or combination of the two strategiesWhat mode of development does the writer use Does she use more than one modeMy mother never workedBonnie Smith-Yackel“Social Security Office” (The voice answering the telephone sounds very self-assured.)“I’m calling about…I… my mother just died…I was told to call you and see abouta…death-benefit check, I think they call it…”“I see. Was your mother on Social Security How old was she”“Yes…she was seventy-eight….”“Do you know her number”“No…I, ah…don’t you have a record”“Certainly. I’ll look it up. Her name”“Smith. Martha Smith. Or maybe she used Martha Ruth Smith….Sometimes she used her maiden name… Martha Jerabek Smith.”“If you’d care to hold on, I’ll check our records—it’ll be a few minutes.”“Yes…”Her love letters—to and from Daddy—were in an old box, tied with ribbons and stiff, rigid-with-age leather thongs: 1918 through 1920; hers written on stationery from the general store she had worked in full-time and managed, single-handed, after her graduation from high school in 1913; and his, at first, on YMCA or Soldiers and Sailors Club stationery dispensed to the fighting men of World War I. he wooed her thoroughly and persistently by mail, and though she reciprocated all his feelings for her, she dreaded marriage….“It’s so hard for me to decide when to have my wedding day—that’s all I’ve thought about these last two days. I have told you dozens of times that I won’t be afraid of married life, but when it comes down to setting the date and then picturing myself a married woman with half a dozen or more kids to look after, it just makes me sick…. I am weeping right now—I hope that some day I can look back and say how foolish I was to dread it all.”They married in February 1921, and began farming. Their first baby, a daughter, was born in January 1922, when my mother was 26 years old. The second baby, a son, was born in March 1923. They were renting farms; my father, besides working his own fields, also was a hired man for two other farmers. They had no capital initially, and had to gain it slowly, working from dawn until midnight every day. My town-bred mother learned to set hens and raise chickens, feed pigs, milk cows, plant and harvest a garden, and can every fruit and vegetable she could scrounge. She carried water nearly a quarter of a mile from the well to fill her wash boilers in order to do her laundry on a scrub board. She learned to shuck grain, feed threshers, shock and husk corn, feed corn pickers. In September 1925, the third baby came, and in June 1927, the fourth child—both daughters. In 1930, my parents had enough money to buy their own farm, and that March they moved all their livestock and belongings themselves, 55 miles over rutted, muddy roads.In the summer of 1930 my mother and her two eldest children reclaimed a 40-acre field from Canadian thistles, by chopping them all out with a hoe. In the other fields, when the oats and flax began to head out, the green and blue of the crops were hidden by the bright yellow of wild mustard. My mother walked the fields day after day, pulling each mustard plant. She raised a new flock of baby chicks—500—and she spaded up, planted, hoed, and harvested a half-acre garden.During the next spring their hogs caught cholera and died. No cash that fall. And in the next year the drought hit. My mother and father trudged from the wellto the chickens, the well to the calf pasture, the well to the barn, and from the well to the garden. The sun came out hot and bright, endlessly, day after day. The crops shriveled and died. They harvested half the corn, and ground the other half, stalks and all, and fed it to the cattle as fodder. With the price at four cents a bushel for the harvested crop, they couldn’t afford to haul it into town. They burned it in the furnace for fuel that winter.In 1934, in February, when the dust was still so thick in the Minnesota air that our parents couldn’t always see from the house to the barn, their fifth child—a fourth daughter—was born. My father hunted rabbits daily, and my mother stewed them, fried them, canned them, and wished out loud that she could taste hamburger once more. In the fall the shotgun brought prairie chickens, ducks, pheasant, and grouse. My mother plucked each bird, carefully reserving the breast feathers for pillows. In the winter she sewed night after night, endlessly, begging cast-off clothing from relatives, ripping apart coats, dresses, blouses, and trousers to remake them to fit her four daughters and son. Every morning and every evening she milked cows, fed pigs and calves, cared for chickens, picked eggs, cooked meals, washed dishes scrubbed floors, and tended and loved her children. In the spring she planted a garden once more, dragging pails of water to nourish and sustain the vegetables for the family. In 1936 she lost a baby in her sixth month.In 1937 her fifth daughter was born. She was 42 years old. In 1939 a second son, and in 1941 her eighth child—and third son.But the war had come, and prosperity of a sort. The herd of cattle had grown to 30 head; she still milked morning and evening. Her garden was more than a half acre—the rains had come, and by now the Rural Electricity Administration and indoor plumbing. Still she sewed—dresses and jackets for the children, housedresses and aprons for herself, weekly patching of jeans, overalls, and denim shirts. Still she made pillows, using the feathers she had plucked, and quilts every year—intricate patterns as well as patchwork, stitched as well as tied—all necessary bedding for her family. Every scrap of cloth too small to be used in quilts was carefully saved and painstakingly sewed together in strips to make rugs. She still went out in the fields to help with the haying whenever there was a threat of rain.In 1959 my mother’s last child graduated from high school. A year later the cows were sold. She still raised chickens and ducks, plucked feathers, made pillows, baked her own bread, and every year made a new quilt—now for a married child or for a grandchild. And her garden, that huge, undying symbol of sustenance, was as large and cared for as in all the years before. The canning, and now freezing, continued. In 1969, on a June afternoon, mother and father started out for town so that she could buy sugar to make rhubarb jam for a daughter who lived in Texas. The car crashed into a ditch. She was paralyzed from the waist down.In 1970 her husband, my father, died. My mother struggled to regain some competence and dignity and order in her life. At the rehabilitation institute, where they gave her physical therapy and trained her to live usefully in a wheelchair, the therapist told me: “She did fifteen pushups today—fifteen! She’s almost seventy-five years old! I’ve never known a woman so strong!”From her wheelchair she canned pickles, baked bread, ironed clothes, wrote dozens of letters weekly to her friends and her “half dozen or more kids,” and made three patchwork housecoats and one quilt. She made balls and balls of carpet rags—enough for five rugs. And kept all love letters.“I think I’ve found your mother’s record—Martha Ruth Smith; married to Ben F. Smith”“Well, that’s right.”“Well, I see that she was getting a widow’s pension….”“Yes, that’s right.”“Well, your mother isn’t entitled to our $255 death benefit.”“Not entitled! But why”The voice on the telephone explains patiently:“Well, you see—your mother never worked.”What is the thesis in this essay Where is it expressedHow well do the writer’s examples support her thesisAside from the extended example of her mother’s life, what other mode of development does the writer use in the essayWhy does the writer give so few details about her father and the family’s children。

相关文档
最新文档