0% found this document useful (0 votes)
51 views9 pages

Computer Organization: A Presentation Submitted by Disha Bhagwat (3503) Anuja Suryan (3546) Ruchita Wani (3551)

This document provides an overview of deadlock handling in Windows and Linux, library hierarchies, static vs dynamic linking, and dynamic loading and linking. It discusses the four conditions required for a deadlock, describes the essential shared library folder (/lib) in Linux and other library folders, explains how to create static and dynamic libraries in Linux, and outlines the linking and loading process in Linux using functions like dlopen, dlsym, dlerror, and dlclose.

Uploaded by

Anuja Suryan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views9 pages

Computer Organization: A Presentation Submitted by Disha Bhagwat (3503) Anuja Suryan (3546) Ruchita Wani (3551)

This document provides an overview of deadlock handling in Windows and Linux, library hierarchies, static vs dynamic linking, and dynamic loading and linking. It discusses the four conditions required for a deadlock, describes the essential shared library folder (/lib) in Linux and other library folders, explains how to create static and dynamic libraries in Linux, and outlines the linking and loading process in Linux using functions like dlopen, dlsym, dlerror, and dlclose.

Uploaded by

Anuja Suryan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

COMPUTER

ORGANIZATION
A PRESENTATION SUBMITTED BY
DISHA BHAGWAT (3503)
ANUJA SURYAN (3546)
RUCHITA WANI (3551)
OVERVIEW
● Deadlocks handling in Windows and Linux
● Library hierarchy
● Static vs Dynamic Linking
● Dynamic loading and linking
DEADLOCKS
● A deadlock occurs when two or more tasks permanently block each other by each task having a lock on a resource
which the other tasks are trying to lock.
● Deadlocks occur if following 4 conditions hold simultaneously:
○ Mutual Exclusion
○ Hold and Wait
○ No preemption
○ Circular wait
/lib – Essential Shared Libraries

The lib folder is a library files directory which contains all

helpful library files used by the system. In simple terms,

these are helpful files which are used by an application or a

command or a process for their proper execution.


/lib/'machine-architecture'

/lib/iptables

/lib/kbd
OTHER LIBRARY FOLDERS IN LINUX
/lib/modules/'kernel-version'

/usr/lib – All software libraries are installed here.


/lib/modules/'kernel-version'/isapnpmap.dep
This does not contain system default or kernel
/lib/modules/'kernel-version'/modules.dep
libraries.

/usr/local/lib – To place extra system library files /lib/modules/'kernel-version'/pcimap

here. These library files can be used by different /lib/modules/'kernel-version'/usbmap


applications.
/lib/oss
/var/lib – Holds dynamic data libraries/files like
/lib/security
the rpm/dpkg database and game scores.
Static Vs Dynamic Linking
Creating libraries in Linux

Creating a dynamic library in Linux Creating a static library in Linux

1. Creating object files: gcc *.c -c -fpic 1. Creating object files: gcc *.c -c -fpic
2. Compiling object files into dynamic 2. Archive the library: ar rcs liball.a *.0
library: gcc *0 -shared -o liball.so 3. Including a prototype for each of the
3. Adding the location for the library file: function that exist in the created library
export LD_LIBRARY_PATH=$PWD:
$LD_LIBRARY_PATH
Dynamic loading and linking within Linux

LINKING:
In Unix-like systems that use ELF for executable images and dynamic libraries, such as Solaris, 64-bit versions of
HP-UX, Linux, FreeBSD, NetBSD, OpenBSD, and DragonFly BSD, the path of the dynamic linker that should be
used is embedded at link time into the .interp section of the executable's PT_INTERP segment. In those systems,
dynamically loaded shared libraries can be identified by the filename suffix .so (shared object).
LOADING:
Loading the library is accomplished with dlopen on UNIX-like operating systems. Examples follow:

Most UNIX-like operating systems (Solaris, Linux, *BSD, etc.)


void* sdl_library = dlopen("libSDL.so", RTLD_LAZY);
if (sdl_library == NULL) {
// report error ...
} else {
// use the result in a call to dlsym
}

Function Description

dlopen Makes an object file accessible to a program

dlsym Obtains the address of a symbol within a dlopen ed object file

dlerror Returns a string error of the last error that occurred

dlclose Closes an object file

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy