Major Issues with Multi-Threaded Programs

Kristi Castro
Updated on 31-Jan-2020 10:24:32

7K+ Views

Multithreaded programs allow the execution of multiple parts of a program at the same time. These parts are known as threads and are lightweight processes available within the process.Threads improve the application performance using parallelism. They share information like data segment, code segment files etc. with their peer threads while they contain their own registers, stack, counter etc.Some of the issues with multithreaded programs are as follows −Let us see them one by one −Increased Complexity − Multithreaded processes are quite complicated. Coding for these can only be handled by expert programmers.Complications due to Concurrency − It is difficult to ... Read More

Multithreaded Priority Queue in Python

Mohd Mohtashim
Updated on 31-Jan-2020 10:24:30

1K+ Views

The Queue module allows you to create a new queue object that can hold a specific number of items. There are following methods to control the Queue −get() − The get() removes and returns an item from the queue.put() − The put adds item to a queue.qsize() − The qsize() returns the number of items that are currently in the queue.empty() − The empty( ) returns True if queue is empty; otherwise, False.full() − the full() returns True if queue is full; otherwise, False.Example#!/usr/bin/python import Queue import threading import time exitFlag = 0 class myThread (threading.Thread):    def __init__(self, threadID, name, q): ... Read More

Usage of Margin Top Property with CSS

Arjun Thakur
Updated on 31-Jan-2020 10:24:12

72 Views

The margin-top specifies the top margin of an element. It can have a value in length, % or auto.ExampleYou can try to run the following code to set the top margin                            This is a paragraph with a specified top margin                      This is another paragraph with a specified top margin in percent          

Usage of border-bottom-color Property in CSS

Chandu yadav
Updated on 31-Jan-2020 10:23:19

62 Views

The border-bottom-color property changes the color of the bottom border.ExampleYou can try to run the following code to implement the border-bottom-color property:                    p.demo {             border:3px solid;             border-bottom-color:#FF0000;          }                              Example showing border top color property          

Usage of Border Width Property in CSS

Ankith Reddy
Updated on 31-Jan-2020 10:21:55

127 Views

The border-width property changes the color of the right border.ExampleYou can try to run the following code to implement the border-width property:                            Example showing border width and style          

Change the Style of the Right Border with CSS

Lakshmi Srinivas
Updated on 31-Jan-2020 10:21:16

150 Views

The border-right-style property changes the style of right border. You can try to run the following code to implement border-right-style property:Example                            Example showing right border          

Synchronizing Threads in Python

Mohd Mohtashim
Updated on 31-Jan-2020 10:21:11

11K+ Views

The threading module provided with Python includes a simple-to-implement locking mechanism that allows you to synchronize threads. A new lock is created by calling the Lock() method, which returns the new lock.The acquire(blocking) method of the new lock object is used to force threads to run synchronously. The optional blocking parameter enables you to control whether the thread waits to acquire the lock.If blocking is set to 0, the thread returns immediately with a 0 value if the lock cannot be acquired and with a 1 if the lock was acquired. If blocking is set to 1, the thread blocks and wait for the lock to be released.The release() method ... Read More

Set Dashed Line for Border with CSS

George John
Updated on 31-Jan-2020 10:20:44

666 Views

To set the dashed line for the border, use the border-style property. You can try to run the following code to implement border-style property value dashed to set dashed border:Example                            This is a dotted border.          

Starvation and Deadlock

Kristi Castro
Updated on 31-Jan-2020 10:20:36

7K+ Views

Starvation and Deadlock are situations that occur when the processes that require a resource are delayed for a long time. However they are quite different concepts.Details about starvation and deadlock are given as follows −StarvationStarvation occurs if a process is indefinitely postponed. This may happen if the process requires a resource for execution that it is never alloted or if the process is never provided the processor for some reason.Some of the common causes of starvation are as follows −If a process is never provided the resources it requires for execution because of faulty resource allocation decisions, then starvation can ... Read More

Set Dotted Line Border with CSS

Samual Sam
Updated on 31-Jan-2020 10:20:12

2K+ Views

To set the dotted line for the border, use the border-style property.ExampleYou can try to run the following code to implement border-style property value dotted to set dotted border:                            This is a dotted border.          

Advertisements