Data Communications and Networking COMP 2330 Laboratory 6 Mr. Wilman ZOU Please sign your name with your attendance.

Slides:



Advertisements
Similar presentations
OpenGL Open a Win32 Console Application in Microsoft Visual C++.
Advertisements

For(int i = 1; i
C Functions. What are they? In general, functions are blocks of code that perform a number of pre-defined commands to accomplish something productive.
Buffer Overflow Prabhaker Mateti Wright State University.
void count_down (int count) { for(i=count; i>1; i--) printf(" %d\t", count); } printf("A%d\n", count); if(count>1) count_down(count-1); printf("B%d\n",
CS 450 Module R4. R4 Overview Due on March 11 th along with R3. R4 is a small yet critical part of the MPX system. In this module, you will add the functionality.
1 Chapter 10 Strings and Pointers. 2 Introduction  String Constant  Example: printf(“Hello”); “Hello” : a string constant oA string constant is a series.
Module R2 Overview. Process queues As processes enter the system and transition from state to state, they are stored queues. There may be many different.
Chapter 7 Process Environment Chien-Chung Shen CIS, UD
By Senem Kumova Metin 1 POINTERS + ARRAYS + STRINGS REVIEW.
Concurrency. What is Concurrency Ability to execute two operations at the same time Physical concurrency –multiple processors on the same machine –distributing.
1 Data Communications and Networking Socket Programming Part II: Design of Server Software Reference: Internetworking with TCP/IP, Volume III Client-Server.
Starts to load image Delay on network Load some more of the image Time for some word processing Thread 2 Thread 1 Figure 15.1 Two threads sharing the processor.
Ceng Operating Systems Chapter 2.1 : Processes Process concept Process scheduling Interprocess communication Deadlocks Threads.
Client Server Model The client machine (or the client process) makes the request for some resource or service, and the server machine (the server process)
Overview Review – what constitutes a thread Creating threads – general Creating threads – Java What happens if synchronization is not used? Assignment.
Data Communications and Networking COMP 2330 Laboratory 5 Mr. Kaiyong Zhao Please sign your name with your attendance.
Data Communications and Networking COMP 2330 Laboratory 2 Mr. Kaiyong Zhao Please sign your name with your attendance.
Pointers Example Use int main() { int *x; int y; int z; y = 10; x = &y; y = 11; *x = 12; z = 15; x = &z; *x = 5; z = 8; printf(“%d %d %d\n”, *x, y, z);
Threads CNS What is a thread?  an independent unit of execution within a process  a "lightweight process"  an independent unit of execution within.
Data Communications and Networking COMP 2330 Laboratory 1 Mr. Kaiyong Zhao Please sign your name with your attendance.
Peter Juszczyk CS 492/493 - ISGS. // Is this C# or Java? class TestApp { static void Main() { int counter = 0; counter++; } } The answer is C# - In C#
Console and File I/O - Basics Rudra Dutta CSC Spring 2007, Section 001.
Lecture No: 16. The scanf() function In C programming language, the scanf() function is used to read information from standard input device (keyboard).
Web Proxy Server. Proxy Server Introduction Returns status and error messages. Handles http CGI requests. –For more information about CGI please refer.
Chapter 18 I/O in C. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Standard C Library I/O commands.
CMPE13 Cyrus Bazeghi Chapter 18 I/O in C. CMPE Standard C Library I/O commands are not included as part of the C language. Instead, they are part.
Introduction to Threads CS240 Programming in C. Introduction to Threads A thread is a path execution By default, a C/C++ program has one thread called.
By Sidhant Garg.  C was developed between by Dennis Ritchie at Bell Laboratories for use with the Unix Operating System.  Unlike previously.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
Ethernet Driver Changes for NET+OS V5.1. Design Changes Resides in bsp\devices\ethernet directory. Source code broken into more C files. Native driver.
Command Line Arguments plus Variable-Length Arrays Systems Programming.
1 Chapter 2.1 : Processes Process concept Process concept Process scheduling Process scheduling Interprocess communication Interprocess communication Threads.
UNIX Files File organization and a few primitives.
File IO and command line input CSE 2451 Rong Shi.
CUDA Streams These notes will introduce the use of multiple CUDA streams to overlap memory transfers with kernel computations. Also introduced is paged-locked.
Overflow Examples 01/13/2012. ACKNOWLEDGEMENTS These slides where compiled from the Malware and Software Vulnerabilities class taught by Dr Cliff Zou.
1 COMP445 Fall 2006 Lab assignment 1. 2 STEP1: Get the name of the second party STEP2: Get phone number from white pages CALLERRECEIVER STEP1: Plug the.
Threads CSIT 402 Data Structures II. many to oneone to one many to many Multithreading models.
UPC Performance Tool Interface Professor Alan D. George, Principal Investigator Mr. Hung-Hsun Su, Sr. Research Assistant Mr. Adam Leko, Sr. Research Assistant.
What is exactly Exploit writing?  Writing a piece of code which is capable of exploit the vulnerability in the target software.
Chapter 11: Data Files and File Processing Files and streams Creating a sequential access file Reading data from a sequential access file Using fgetc()
Slides created by: Professor Ian G. Harris Hello World #include main() { printf(“Hello, world.\n”); }  #include is a compiler directive to include (concatenate)
MP2 Discussion Session CS414 Spring 2010 Long Vu 2/16/2010.
13 June 2001M.Al-Turany/Root20011 Mohammad Al-Turany Go4 GSI Darmstadt 13 June 2001.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming Input and Output.
Cs423-cotter1 Windows Operating Environment. cs423-cotter2 Windows Operating Environment 32 bit operating environment – Windows XP Microsoft Visual Studio.net,.net2005,
Introduction to Computer Organization & Systems Topics: Command Line Bitwise operators COMP Spring 2014 C Part V.
STACK Data Structure
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Shared Memory December 2013.
task ReadContent(String^ filename) { anim->Start(); auto t = create_task(KnownFolders::DocumentsLibrary-> GetFileAsync(filename)).then( [](StorageFile^
Files A collection of related data treated as a unit. Two types Text
Lecture 20: C File Processing. Why Using Files? Storage of data in variables and arrays is temporary Data lost when a program terminates. Files are used.
Chapter 7 Process Environment Chien-Chung Shen CIS/UD
Lecture Lecture 25 Review of Last Lecture DLL’s DLL’s Processes Processes Threads Threads Memory Management Memory Management.
CSC 482/582: Computer Security
Week 12 - Wednesday CS222.
Threads in C Caryl Rahn.
مراجعة عامة.
Files I/O, Streams, I/O Redirection, Reading with fscanf
Lecture 13 Input/Output Files.
در تجزیه و تحلیل شغل باید به 3 سوال اساسی پاسخ دهیم Job analysis تعریف کارشکافی، مطالعه و ثبت جنبه های مشخص و اساسی هر یک از مشاغل عبارتست از مراحلی.
Beginning C Lecture 11 Lecturer: Dr. Zhao Qinpei
Accessing Files in C Professor Hugh C. Lauer CS-2303, System Programming Concepts (Slides include materials from The C Programming Language, 2nd edition,
CNT4704: Analysis of Computer Communication Network Buffer Overflow : Example of Using GDB to Check Stack Memory Cliff Zou Fall 2011.
Midterm Review CSE321 B.Ramamurthy 2/22/2019 B.Ramamurthy.
ECE 103 Engineering Programming Chapter 51 Random Numbers
Displaying Memory/Files
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow : Example of Using GDB to Check Stack Memory Cliff Zou Spring 2010.
Week 12 - Wednesday CS222.
Presentation transcript:

Data Communications and Networking COMP 2330 Laboratory 6 Mr. Wilman ZOU Please sign your name with your attendance

Job 1 Job 2 Job 3 Single Thread Job 2 Job 1 Job 3 Multi-thread Job1,job2,job3

Some functions _beginthread() –To create a new thread; –uintptr_t _beginthread( void( *start_address )( void * ), unsigned stack_size, void *arglist ); void( *start_address )( void * ): a point to the function/ unsigned stack_size: specify the size of the stack for the created thread void *arglist: the pointer of arguments list

Some functions fflush() –To clean the buffer, –int fflush( FILE *stream ); FILE *stream: a pointer to FILE structure, this FILE structure will base on a buffer When fflush try to clean the buffer, the system will first conduct the commands to treat the data in buffer Intuitively, fflush() after printf() means that display the printf() result without delay