EmbLogic's Blog

Category Archives: Project 04: FTP based Client Server using Threads and Sockets

The POSIX thread libraries are a standards based thread API for C/C++. It allows one to spawn a new concurrent process flow. It is most effective on multi-processor or multi-core systems where the process flow can be scheduled to run on another processor thus gaining speed through parallel or distributed processing. Threads require less overhead than “forking” or spawning a new process because the system does not initialize a new system virtual memory space and environment for the process. While most effective on a multiprocessor system, gains are also found on uniprocessor systems which exploit latency in I/O and other system functions which may halt process execution. Parallel programming technologies such as MPI and PVM are used in a distributed computing environment while threads are limited to a single computer system. All threads within a process share the same address space. A thread is spawned by defining a function and its arguments which will be processed in the thread. The purpose of using the POSIX thread library in your software is to execute software faster.
Sockets are the fundamental technology for programming software to communicate on TCP/IP networks. A socket provides a bidirectional communication endpoint for sending and receiving data with another socket. Socket connections normally run between two different computers on a LAN or across the Internet, but they can also be used for interprocess communication on a single computer.

Code to demonstrate how to pass integer data to a thread.

RCS file: passing_data_to_threads.c,v Working file: passing_data_to_threads.c head: 1.9 branch: locks: strict root: 1.9 access list: symbolic names: keyword substitution: kv total revisions: 9;    selected revisions: 9 description: Code to demonstrate how to pass data to threads. —————————- revision 1.9    locked … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

Creating two threads which then display two different messages untill a condition is satisfied and making the main thread to wait for them to finish.

RCS file: simple_thread.c,v Working file: simple_thread.c head: 1.14 branch: locks: strict root: 1.14 access list: symbolic names: keyword substitution: kv total revisions: 14;    selected revisions: 14 description: A simple thread program in which 2 threads are created and 2 separate … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

socket programming

1 head    1.1; 2 access; 3 symbols; 4 locks 5         root:1.1; strict; 6 comment @ * @; 7 8 9 1.1 10 date    2013.12.31.10.09.33;    author root;    state Exp; 11 branches; 12 next    ; 13 14 15 desc 16 @AF_INET server … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

Socket (AF_INET)

Log file for server head    1.1; access; symbols; locks root:1.1; strict; comment    @ * @; 1.1 date    2013.12.30.10.47.35;    author root;    state Exp; branches; next    ; desc @source file for ftp server ————————————————————————————————————————————- log file for client head    1.1; access; symbols; … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Tagged , | Leave a comment

Client Server Communication using AF_INET Sockets [RCS Log]

HEADER RCS head    1.1; access; symbols; locks; strict; comment @ * @; 1.1 date    2013.12.30.09.22.36;    author raman;   state Exp; branches; next    ; desc @this is header file CLIENT RCS head    1.1; access; symbols; locks; strict; comment @ * @; 1.1 … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

SOCKET programming (client server implementation)

SERVER LOG FILE head    1.1; 2 access; 3 symbols; 4 locks 5         root:1.1; strict; 6 comment @ * @; 7 8 9 1.1 10 date    2013.12.29.10.12.34;    author root;    state Exp; 11 branches; 12 next    ; 13 14 15 desc 16 … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

Socket (AF_UNIX)

log file for server head    1.2; access; symbols; locks; strict; comment    @ * @; 1.2 date    2013.12.29.09.42.09;    author root;    state Exp; branches; next    1.1; 1.1 date    2013.12.29.09.35.38;    author root;    state Exp; branches; next    ; desc @main server file for socket … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Tagged , | Leave a comment

Server – Client using Threads

Log file for server head    1.1; access; symbols; locks; strict; comment    @ * @; 1.1 date    2013.12.28.07.56.32;    author emblogic;    state Exp; branches; next    ; desc @server with thread is created. data from client to thread . @ ———————————————————————- log file … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets, Uncategorized | Tagged , | Leave a comment

Introduction to Threads

Introduction To THREADS Threads, like processes are a mechanism to allow a program to do more than one thing at a time. In Linux when a process is created, it already contains a thread, used to execute the main() function. … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

Article on POSIX THREADS

Thread Progrmming Thread:Multiple strands of execution in a single program are called threads. A more precise definition is that athread is a sequence of control within a process.All processes have at least one thread of execution.When a process executes a … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

THREADS AND SOCKETS

THREADS AND SOCKETS MECHANISMS  INTRODUCTION OF THREADS: Multiple strands of execution in a single program are called threads. All processes have at least one thread. All threads in a program execute simultaneously and perform their function individually. Threads are the … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

Threads:

Can we manually switch between two Threads of a process ?? Means, is it possible to context out a running thread and context in a user desired thread, at any time????

Posted in Project 04: FTP based Client Server using Threads and Sockets | Tagged , , | Leave a comment

E 30: JATINDER KUMAR

Implemented project 4 using thread successfully. run successfully 1021 clients at a time. in this project i have used one fifo for requesting and one fifo for final result in between clients and server. on other side i used messgae … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets, Uncategorized | Tagged | 1 Comment

E30 : Taruna

Implemented the project using detached threads .. Serving 1021 clients.

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

E30:Monika

RCS file: server.c,v Working file: server.c head: 1.1 branch: locks: strict user1: 1.1 access list: symbolic names: keyword substitution: kv total revisions: 1;     selected revisions: 1 description: This is client-server based implementation of multiple threads. It is implemented using msgqueues … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment