Programming :: Implementing Sleeping Barber's With Multiple Barbers?

Oct 11, 2010

I'm working on a problem in which i have to implement the regular sleeping barber problem with multiple (say n) barbers. The code i'm using is this :

#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<pthread.h>
#include<errno.h>
#include<sys/ipc.h>
#include<semaphore.h>
[Code]...

how to implement the modification? (there are many more such modifications where i'm stuck , but will ask about those later)

View 6 Replies


ADVERTISEMENT

Programming :: Implementing A Garbage Collector In C++?

Aug 27, 2009

I'm interested in writing a generational garbage collector in C++. This is for a Python-like programming language project. I have used Boehm's garbage collector before, but I'm worried that it will have noticeable pause times (unacceptable for interactive programs). Since I can't really find any other C++ established GCs out there, I have been thinking of simply writing my own.

However, there are two essential ingredients I need for this:

- Some kind of write barrier mechanism that will notify my collector when something is written to a part of the heap

- A way for me to know the addresses and sizes of the stack, heap and global storage (the root sets)

how to implement write barriers (and how to get the stack, heap and global storage information) on the Linux platform? As an alternative, if you know of C++ GCs other than Boehm, I would also be interested.

View 14 Replies View Related

Programming :: Implementing Scrollbar Using Xlib ?

Oct 17, 2010

I am working on xlib project to develop text editor without using help from any of toolkit/widgets.I get stuck in scrollbar.I have no idea how they work and developed.It become more difficult as I am using low-level C library - xlib.

View 1 Replies View Related

Programming :: Implementing Search Engine Optimization (SEO)

Mar 31, 2011

Though I have developed some web applications (automation tools) using PHP which have been primarily meant for Intranet (within the organizations I have worked for), I have paid little attention to SEO (it was not required until now). But now I want to understand how do we go about implementing SEO and where do we fit this mechanism in a system / website?

Do we need any other tools or learn some specific programming /scripting language to achieve it?Will implementing a good SEO yield identical results irrespective of what search engine (be it Google or Yahoo!) is being used by users?

View 1 Replies View Related

Programming :: Implementing Hamming Code In C Lang?

Sep 12, 2010

implementing hamming code in c: Calculating the Hamming Code The key to the Hamming Code is the use of extra parity bits to allow the identification of a single error. Create the code word as follows:

Mark all bit positions that are powers of two as parity bits. (positions 1, 2, 4, 8, 16, 32, 64, etc.)
All other bit positions are for the data to be encoded. (positions 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, etc.)

[code]....

View 2 Replies View Related

Programming :: Implementing A Classless Qdisc (a Scheduler)?

May 13, 2011

i am running linux kernel 2.6.32-30 and my aim is to do packet aggregation in linux,so i created a qdisc simple one like sch_fifo.c and i wanted to put upon the dequeue function but when i attach my qdisct with tc qdisc add dev wlan0 root aggregate my screen just go black and in var/log/messages it says 31 m of stolen memory.graphic perfomance may suffer. can you somebody pls help me. Below is my dequeue function.

static struct sk_buff *aggregate_dequeue(struct Qdisc *sch)
{
struct sk_buff *skb;
struct packet_buffer *packet_buffer = {0};
packet_buffer->size=0;
skb = __skb_dequeue(&sch->q);

[Code]...

View 1 Replies View Related

Debian Programming :: Implementing PyGtk For Python 3.3 In Wheezy

Sep 12, 2013

I run Wheezy Xfce 64-bit. I went through the Synaptic listings and added Python 3.3.2 and Tkinter for it, and that works fine; but for some reason PyGtk is available only for Python 2.7, not for Python 3.3, unless I'm just using the wrong way to try to find it. Is there a PyGtk available for Python 3.3 in Wheezy, and, if so, how do I install it and then import it once it's installed?

View 1 Replies View Related

Programming :: Data Structure For Implementing A Text Editor?

Nov 15, 2010

Options:A double linked list with fixed size character arrays. New nodes will be added when previous ones get filled. Dynamic arrays using realloc(). Linked list has the disadvantage of not having an O(1) search like an array but I think using realloc() will be more dangerous since it moves the whole block to a new location and if the new location is not big enough to hold the whole block, realloc fails !! this case will not occur with the linked list since its nodes are scattered.

View 14 Replies View Related

Programming :: Encryption / Implementing AIDE On Client Machines?

Aug 22, 2010

I need to implement AIDE on my client machines. The builds on these machine are different, so each workstation will have its own specific db generated through running AIDE initially. It is not good practice to just leave the db on the machine, since an "attacker" would be able to view this information. However, at the same time I do not want to pull back over 100 different aide db's to the ftp server and have an update pull each specifically every time I need to run the check. The plan is to leave the db on the client machine, but encrypt it (using public/private keys). I need to be able to encrypt the file on the client machine. I will use a cron on the client to pull an update (from my ftp server) that runs AIDE. This update needs to be able to decrypt the file, use it running AIDE, then re-encrypt the file on the client.

View 1 Replies View Related

Programming :: GNU Common LISP Package Implementing Forkpty()?

Mar 21, 2011

I seek a GNU Common LISP package which implements forkpty(); openpty() would also be a big plus, and login_tty() would be a luxury I could live with.

View 3 Replies View Related

Programming :: Implementing Matrix Based Keypad On X86 Processor Using GPIO's?

Feb 5, 2010

I need to control matrix 5x4 keypad, on a processor

i am doing by making one row low at a time, and keeping all other rows high,

by scaning coloums, the corresponding key value becomes low.

my problems is that it is taking much time to respond, like to make gpio

low to high and high to low...

View 1 Replies View Related

Programming :: Programming To Multiple Video Cards

Jun 24, 2009

I've browsed the internet, but haven't found a satisfying answer. Hope this forum can help me in the right direction.I'm exploring the possibilities of creating a program that manipulates (writes to) two different video cards.I program in C and hope to avoid high level libraries like Xlib to keep the mem footprint as low and the performance as high as possible. Windowing is not important no desktop environment will be used. Be able to write two pixels (one to each screen) to would do.

How would I go about?To give an idea of the solution I'm looking for:One screen will show thumbnails of images on the hard drive. Clicking an thumbnail on display A will show the selection full screen on display B. On a laptop; preferably thumbnails on the laptop screen and the selected image on the external monitor.Is this possible with just low-level libs or do I need X or some third-party software to make life easy?

View 14 Replies View Related

Ubuntu :: 10.4 - Computer Not Sleeping When Close Lid

May 1, 2010

I just installed ubuntu 10.4 and when I close my laptop, it does not go to sleep. The hard drive is still on and the computer is still working even after I have closed it.

View 9 Replies View Related

Ubuntu :: Lucid Is Sluggish After Sleeping?

Jun 9, 2010

Having woken her up, she is often very bleary eyed with no energy and little movement. It takes her quite a time to be fully functional. Are there any settings that reduce the time between waking up and full efficiency?

View 6 Replies View Related

Networking :: Wicd Has Connecting To New AP's After Sleeping?

Jul 6, 2011

I was using wicd on a spotty network, the house blocked a lot of the signal from moving around, so wicd was having major issues with that AP. Later I was trying to connect to another AP but wicd couldn't connect plus it was saying the spotty network's name was the one it was connecting to. Although I didn't try before I left/gave up I'm sure a restart of the wicd daemon would have solved it.

But why is this even the case? is there something I could add to the scripts that would clear this issue up? (I also submitted a bug on wicd's launchpad project but haven't gotten any response... I hope this isn't a 'feature')

View 3 Replies View Related

General :: Blocking Or Sleeping An Interrupt Handler?

Dec 2, 2010

Assume: 1) Multi-cpu environment 2) Process that gets interrupted, is the same process that executes the interrupt handler, so I guess technically nothing gets interrupted except what the process was doing before, but it is still executing as it is executing the handler. 3) There is no top or bottom half, when an interrupt takes place the handler is invoked, executes, then return from interrupt, simple as that.

Why would sleeping the handler (puts in sleep queue, context switch to next runnable process) be a bad idea?

View 1 Replies View Related

Ubuntu :: Eee904hd Sleeping Randomly / Solution For This?

Apr 30, 2010

Yesterday, I clean installed the netbook remix of 10.04 , all went well, until I removed the power cable.

While off mains the netbook will randomly sleep, I really can't seem to find a trigger for it.

In the power settings I have changed various options to alter this but nothing seems to affect this.

This machine had xp on previously without a similar problem, so I am ruling out a faulty lid trigger. (Doesn't happen with powered on mains)

View 2 Replies View Related

Ubuntu :: Prevent External Drive From Sleeping?

Aug 26, 2010

I have a Hitachi SimpleDrive (LS-1000-EMEA) it has an "Auto-sleep" function which I believe is controlled by the enclosure itself.The problem I'm having is that when the drive goes to sleep Ubuntu does not seem to be able to wake it up again. I am running Karmic 9.10 as a stripped down install with XBMC as a front-end. I cannot access the drive at all when it does this.

I'm not sure if the problem is that the drive is formatted as NTFS. I notice that when the drive is connected to my Mac or PC it resumes no problem (with a slight delay as the drive gets out of standby) but with Ubuntu it just seems to stop responding. When I reboot the drive is not mounted by Ubuntu. Physically, the blue LED indicator on the drive is frozen (i.e. lit-up) rather than flashing as it normally would. I have to actually unplug (from the mains) and plug it back in for it to work.I have tried using sdparm, but as I say I think the sleep function is controlled by the enclosure and thus sdparm gives me no standby options.

View 3 Replies View Related

General :: Mount Mp3 Player (sdb) Without Waking Up Sleeping Sda?

Jun 26, 2010

I would like to mount my mp3 player (sdb) without waking up the sleeping SATA disk sda. Attaching mp3 player does not wake sda up, but mounting it does. My system is mostly Slackware 11, so I'm still on kernel 2.4.

View 5 Replies View Related

Debian Multimedia :: Krusader Remains With A Sleeping Status

Oct 5, 2010

I'm having a problem with krusader. When I open and close it, it remains with a sleep status. This can be verified by the system monitor and by the "ps aux". The krusader only go away if I use killall. This is occurring in more than one machine. I'm using squeeze gnome 64 bits.

View 2 Replies View Related

Ubuntu :: How To Prevent Screen From Sleeping Needing Relogin

Jul 2, 2010

I put power settings to never, but the screen still goes to sleep and moving the mouse you have to login.What I really want is no login screen, and I suppose if you were watching a vid it would go dark?

View 2 Replies View Related

CentOS 5 Hardware :: ATA Command Timeouts After Disk Has Gone Sleeping?

Jul 3, 2010

configured myself a NAS, which is infrequently accessed, so I set the standby timer of the disks to 241 (30 minutes) using hdparm.

for i in /dev/sd?; do
hdparm -S 241 $i > /dev/null
done

[code]....

View 2 Replies View Related

Networking :: Implementing The DSR In NS2?

Mar 5, 2010

i am trying to implement DSR algo by tcl in ns2.but the problem i am facing is that i cannot make out how to circulate the ROUTE-REQUEST & ROUTE-REPLY packet in the established network.

View 2 Replies View Related

Fedora Installation :: 12 LiveUSB Fails To Boot (sleeping Forever..)?

Nov 20, 2009

I've created an LiveUSB disk with the USBcreator method in Windows 7.Now the the image is copied succesfully and the USB key is bootable.However when the boot window popsup and I select the verify & boot option, a graphical loading window comes up and right after that the system halts with the error message "Sleeping forever".What am I doing wrong? Or what is Fedora doing wrong with their LiveCD to USB media?I've did a forum search and the exact same issue is described in this thread[URL]

View 5 Replies View Related

General :: Recover An Application In Sleeping State After An X Server Crash?

Jan 28, 2011

I often run calculations on my Linux computer, which cause my X server to crash from time to time. Almost always, some programs seem to survive to the crash and are in an interruptible sleeping state, for example:29315 ? Sl 54:35 /home/kashim/Desktop/anylogic/anylogic -vmargs -Xmx1024MIs there a way to reconnect these applications with the new X server?

View 1 Replies View Related

Ubuntu Multimedia :: Boxee Beta 64bit - Sleeping Process?

May 15, 2010

I've got the new beta working in ubuntu 64 bit lucid 10.4. But, I have to go to admin/sys monitor and end the boxee "sleeping" process B4 it will start again after exiting The app? Id sure like to fix it.

View 4 Replies View Related

General :: Implementing The Command In C?

Sep 5, 2010

I have been giving the task of shell scripting in C++ for implementation of Secure command in my shell. The Secure command will prompt for the filename and the password (like *****) and can only be displayed when ls -secure and password is provided. For example

>> LS
File1 File2
>> Secure File1
Password:*****

[code].....

View 1 Replies View Related

Fedora Installation :: Error Message - Boot Failure - Sleeping Forever ?

Aug 11, 2011

I have a fresh computer with specs as such:

Hard Drive: Western Digital Caviar Black 500Gb 6Gbs Sata
Asus Sata DVD/CD Burner
Core i3 3.3GHz Sandy Bridge chipset
MSI P67A-GD55 Motherboard
Zotac GTS 450

I have a problem where the live cd gives this error message:

Boot failure, sleeping forever.

View 12 Replies View Related

Red Hat / Fedora :: Can't Mount Root Filesystem - Boot Has Failed - Sleeping Forever

Jan 9, 2010

I've downloaded Fedora 12 and decided to try and install it on my old laptop which is currently running Ubuntu 9.10 with no problems.

When I boot from the live cd, it starts to load with the 3 bars on the bottom, one on top of the other, one is white, one is dark blue, the other is in between those colours in the spectrum somewhere....

Anyway, the load bars complete and "Fedora 12" turns white, then the following output populates:

mount: unknown filesystem type 'DM_Snapshot_Cow' (<----- repeated a bunch of times) can't mount root filesystem Boot has failed, sleeping forever.

View 9 Replies View Related

General :: Kernel Cooking: No Root Device Found Sleeping Forever?

May 3, 2011

I've taken the kernel 2.6.33.3 and edited the .config file to take out most of the compatibility etc. that I will not be using. I'm run the makes and updated grub. I go to boot it runs through most of the way until I get the following:Quote:/bin/plymouthd: symbol lookup error: /bin/plymouthd: undefined symbol:ply_chara could not read byte from child: SuccessNo root device foundBoot has failed, sleeping forever.'m fairly new to Linux and still more of a dabbler. (Though this seemed more difficult than "Who is root" so I didn't put this in the newbie thread.)Any ideas for what might be wrong?I've tried looking in the config file from something that relates, but they have all been included (Y) in the module.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved