91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-29
  • 語(yǔ)言: 其他
  • 標(biāo)簽: SSD6EX6??

資源簡(jiǎn)介

SSD6-EXERCISE6 分?jǐn)?shù)比較高

資源截圖

代碼片段和文件信息



/*
ThreadedClient.cpp

A?threaded?database?client.
?*/

#include?

#include?“servers.h“

#ifdef?_MSC_VER
#include?
#include?se.h>
#include?
typedef?__int64?INT64_T;
typedef?unsigned?__int64?UINT64_T;

typedef?LONGLONG?time_ms_t;

//The?get?personal?infomation?function
void?__cdecl?threadPersonFunc(void?*);
//The?get?account?infomation?function
void?__cdecl?threadAccountFunc(void?*);

//The?personal?ptr
Personal?*pers;
//The?accountInfo?ptr
AccountInfo?*acct;

time_ms_t?getTimeInMilliseconds()?{
SYSTEMTIME?stime;

GetSystemTime(?&stime?);

FILETIME?ftime;
LARGE_INTEGER?time;

SystemTimeToFileTime(?&stime?&ftime?); /*?if?this?fails...?*/

time.HighPart?=?ftime.dwHighDateTime;
time.LowPart?=?ftime.dwLowDateTime;

/*?FileTime?is?in?100ns?intervals?since?1/1/1601?*/
return?time.QuadPart?/?10000;
}
#endif

/*
ostream?&operator?<<(?ostream?&out?string?*str?)?{

Send?a?string?to?an?output?stream.
?*/
ostream?&operator<<(ostream?&out?string?*str)?{
if?(str)
return?out?<data();
else
return?out;
}

/*
????ostream?&?operator<
Print?a?64-bit?unsigned?integer?to?the?given?output?stream.
??*/
ostream?&operator<<(?ostream?&out?INT64_T?snum?)?{
#define?_OSTR_LL_LEN?21
if?(snum)?{
char?buffer[_OSTR_LL_LEN];
int?i?=?_OSTR_LL_LEN?-?1;
????????UINT64_T?num;
if?(snum?
buffer[i]?=?‘\0‘;
while?(num)?{
buffer[--i]?=?(‘0‘?+?(int)?(num?%?10));
num?/=?10;
}
if?(snum? return?out?< }else?return?out?<}

/*
int?main(?int?argc?char?*argv[]

You?should?modify?this?function?to?use?threads.
?*/
int?main(?int?argc?char?*argv[]?)?{
if?(argc?!=?2)?{
cerr?< exit(1);
}
int?account?=?atoi(?argv[1]?);
HANDLE?thread[2];

time_ms_t?start?=?getTimeInMilliseconds();
cout?< cout.flush();

//call?_beginthread?function?to?get?a?thread
thread[0]?=?(HANDLE)?_beginthread(?threadPersonFunc?0?&account?);
thread[1]?=?(HANDLE)?_beginthread(?threadAccountFunc?0?&account?);
//if?call?failed?then?exit
????if?(thread[0]?==?(HANDLE)?-1L?||?thread[1]?==?(HANDLE)?-1L)?{
cerr?< exit(1);
????}
else?{
? WaitForMultipleobjects(?2?thread?true?INFINITE);
????}

time_ms_t?end?=?getTimeInMilliseconds();
cout?<
if?(pers)?{
cout?<FirstName?< <LastName?< cout?<Address?< cout?<Balance?<Pending
<Share?<
delete?pers;
delete?acct;
}else?cout?<
return?0;
}

//The?threadPersonFunc?function?which?is?cal

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件????????696??2008-12-11?20:51??ex6\answers.txt

?????文件????????402??2008-12-11?20:12??ex6\output.out

?????文件???????3370??2009-05-19?11:59??ex6\ThreadedClient.cpp

?????目錄??????????0??2008-12-11?20:52??ex6

-----------?---------??----------?-----??----

?????????????????4468????????????????????4


評(píng)論

共有 條評(píng)論

相關(guān)資源