Applications :: Accessing Shared Data Between Threads Using Mutex?
May 3, 2010
I have written an application which has more than 6 threads.Two threads share a common linked list. Out of two threads one thread reads the linked list node and other thread writes to linked list node.I am using pthread_mutex_lock() API to achieve synchronisation between having access to common linked list. The problem is the first thread which reads the linked list accesses the mutex faster making other thread to starve.
I want both the thread to have an access to mutex. It should not happen that always first thread locks, releases and relocks it. The first thread almost require to access the link list every 5 msec which is causing second thread not to gain the mutex.How should I fix this? For information, I am running this application on PXA270 ARM platform.
View 4 Replies
ADVERTISEMENT
Mar 2, 2011
If multiple threads operate on a single shared resource, we can lock it using pthread_mutex_lock. Uptill that it is fine, but why again pthread_cond_wait?
int shared=0; // global
.
.
// Thread 1
pthread_mutex_lock(&mutex);
shared=1;
pthread_mutex_unlock(&mutex);
When thread1 invokes the mutex lock, no other threads can access it in parallel. So why again and what for we use, pthread_cond_wait( ).
View 2 Replies
View Related
Dec 14, 2010
In posix multi threading, how to send thread1 local data to thread2...?
View 3 Replies
View Related
Sep 22, 2010
I wrote a program that multiplies 2 matrices using multi-threads and another one using multiple processes and shared memory. Both in C.I need to find the total memory usage of these programs. I know of the top command, but when my matrices are relatively small they don't even show up on top because they complete so fast, how can I find the memory usage for these instances?Also, how can I find the total turnaround time of my programs
View 1 Replies
View Related
Jul 24, 2010
I'm trying to add local sockets in my multi-threaded application in order to exchange data between threads. The only problem I got is that most of the information available on the net is related to internet oriented socket programming whileI want to perform local connections. got a thread that does the sniffing via libpcap. And I would like that thread to send each captured packet to a second thread that will analyse the packetof the thread implementations is written in separate .h file.Or maybe there is a more effective method of exchanging data between threads
View 14 Replies
View Related
Oct 13, 2009
I got a ftp server (proftpd on debian) on machine "A" and I got a Samba Server (debian also) on machine "B" with a shared folder called "public". how do I access the shared folder via FTP?
I already tried the following command:
mount -t smbfs //machine B/public /media/public
And the following message appears:
mount: special device //machine B/public does not exist
But the folder public is already shared cUz I can access it using Windows XP.
View 1 Replies
View Related
Feb 11, 2011
Is there any utility that shows, who is accessing( has accessed ) my shared folders. I am using samba to share folders with other windows machines.
View 2 Replies
View Related
Mar 20, 2010
I have two computers set up, one is running Ubuntu 9.04 and the other running Windows 7 Professional. I have a bunch of shared files from Windows 7 (which I am normally able to access from any Windows 7 or Windows XP machine on my network) but I can't access them from Ubuntu.I have tried going to Places > Network > Windows Network, but I receive the error "Unable to mount locations Failed to retrieve share list from server"I have also found another recommendation for accessing a windows server, via Places > Connect to Server, but I receive another error message there, "Cannot display location "smb://..." No application is registered as handling this file."Could anyone explain what my problem is and how I could fix it? I really wish I could figure this stupid thing out myself, but it's linux.. it's not meant to be understood by anyone >.<
View 7 Replies
View Related
Apr 15, 2010
I want to share my /home/myname/Public/ directory with other users on my system. The problem I am having is that it seems impossible to do so. I can't use a hard link because it's a directory and I can't use a soft link because the target directory can't be found by anyone unable to read my home directory.
So far, the only solutions I can see are:
1) To move everything from my Public directory to one lower on the directory tree (something like /home/Public) and then symlink to that as /home/myname/Public and allow everyone else to do the same.
2) To use something like samba to share the folder, even if only locally.
is doable because /home and /home/myname are on the same volume but there are times on my system when that is not true (I have users with their home directories on thumbdrives and external HDDs for instance and keeping their public files on a separate volume really isn't an option).
View 2 Replies
View Related
Jun 2, 2010
I have shared few webpages in /home/vinay/public_html directory and I have made necessary changes in /etc/httpd/conf/httpd.conf file
Code:
But how to access these pages through Browser. When I open the browser with
Code:[url]
It shows contents of index.html in /var/www/html which is default DocumentRoot
How to provide the URL to access webpages in /home/vinay/public_html directory.
View 1 Replies
View Related
Dec 31, 2010
Using a SUSE server, what's the best method/tool available to mount existing shared directories? I have defined shares on a Window 2008 server and am attempting to configure the SUSE server.
View 8 Replies
View Related
Jul 7, 2011
I'm running Ubuntu 11.04 (guest) on Windows 7 (host) with the guest additions installed. I have an auto-mount folder that maps to my D: drive on the host which I can access using sudo ls /media/sf_D_DRIVE - however, even when my user (ross) is a member of the vboxsf group I get a permission denied error when attempting to explore it. I have restarted since adding my user to the vboxsf group.
This should work because I am a member of the group (which has rwx rights), so why doesn't it?
ross@panther:~$ ls -l /media
total 8
drwxrwx--- 1 root vboxsf 8192 2011-07-03 22:24 sf_D_DRIVE
ross@panther:~$ ls -l /media/sf_D_DRIVE/
ls: cannot open directory /media/sf_D_DRIVE/: Permission denied
[Code].....
View 1 Replies
View Related
Jan 4, 2011
I have a NAS running Samba. My Samba shares are accessed from a Windows computer, it works very well.
With the kubuntu 10.04 computer, things are different : I can see the Samba shares in Dolphin, and copy files to the local drive, but lots of applications don't allow me to open a file on a Samba share.
Some applications such as OpenOffice let me browse to the share but refuse to open the remote file
Some other applications don't let me browse to shares at all.
What's up with that ? Surely I'm not the only one wanting to access files on a NAS ? How do other people do it ?
PS I chose kubuntu 10.04 because the 10.10 install hangs, the "ui" workaround I saw here and there did not work, the only solution offered was to go back to 10.04
View 3 Replies
View Related
Dec 7, 2010
I cannot access figure out how to access files stored on a windows share within an application. I can access files on a windows share from places>network but if I am trying to access files from say audacitcy or gtkpod by means of file>open when the application brings up the "places" dialog there is no network Icon to choose from.
View 7 Replies
View Related
Jul 15, 2010
I backed up my windows hard drive using dd and turned it into one huge image file. I didn't realize this beforehand, but this image is not an ISO equivalent type. However, it would be nice if I could access everything on the image just by mounting it instead of having to transfer it back to /dev/sda or something.
View 5 Replies
View Related
Apr 10, 2010
I'm using ext3 and I have my / partition on sda3. This is a full install, it has /bin /home etc etc on it, the only thing I have is sda1 is /boot and sda2 is swap.
I've configured my system to mount sda4 as /home/user as the system boots up, which puts all of my data on sda4.
My question is this. How do I access any data left in (sda3) /home/user? (Because trying that won't work). Is there some way to use a direct path? Like /device/sda3/home/user?
View 1 Replies
View Related
Feb 19, 2011
We purchased a new database system at work last October, ditching the old system because of a lack of support from the vendor. This is a retail Point of Sale and Backoffice database system. I am not sure what system the new one runs on, but the system we replaced was a Firebird data base. The reason I am posting is because we are now in need of the information contained in the old database which was not completely imported into the new system. Unfortunately, we parted company with the old vendor under extremely hostile conditions, and they are not a source of help for this problem, nor are the new vendors.
Basically the problem is this: The database in on a Windows XP system and I found a copy of SQL Manager Lite 2008 on the system, which after quite a bit of studying, I figured out how to extract the database into a removable file. I have this file (178MB) on a USB stick in a file called Backoffice.fbd. I can get into this database with MySQL. All I want to be able to do get into the database and create tab deliminated spreadsheet files for each of the database sections (Customers, Repairs, Sales History, stock files, etc.) Is it possible to do this with Ubuntu and MySQL and if so, can an expert suggest one or two things to get me started.
View 3 Replies
View Related
May 7, 2010
I have to figure out how to pass data between a Fortran application and a C++ application. The memory has to be locked/unlocked to prevent data corruption. I know very little about Fortran. I have done mutex lock/unlock stuff in Linux apps, multi-threaded, using mutex locks before.
Digging around on the Web, I do not find any info on a Fortran app including linux headers, library calls such as those in ipc.h, shm.h and sem.h. What is an approach to this problem?
View 1 Replies
View Related
Jan 10, 2011
I started using Ubuntu's chat tool the other day, I gave it my Gmail username and password,and lo! it found my list of CONTACTS FROM INSIDE GMAIL!Facebook has done the same thing as well! Was this in Google's terms? Can't something be done about this? This is SCARY.But also, a small part of me wants to know how it was done (only a small part, this protocol sh*t is not particularly challenging, right?
View 14 Replies
View Related
Aug 3, 2010
I have a laptop dual booted with windows vista and ubuntu.I downloaded certain movies and music files while using windows vista,which are there in my hard disk,My question is can i access these music and video files when i boot into ubuntu,and can i play them?
View 5 Replies
View Related
Jun 28, 2010
I am using an embedded platform in which I have connected an external harddisk (/dev/sda). The SCSI driver is present and I am using the SG_IO interface for performing the SMART commands with the Hard Disk. (Unfortunately not all the HDIO ioclts are present. So I opted for the SG_IO ioctl). But the data transfer (reading/write data from/to sector) is not working with the SG_IO ioctls. So I searched for some other options. Later in one of the places, I found that we can actually mount the /dev/sda to some mount point in /mnt and then make a XFS file system (mkfs.xfs) of this.
And then we can create the directories and do file operations on this mounted directory. Here the simple read/write systems calls can be used for this. I was thinking about this implementation. But I am confused how I can map the actual LBA (Logical Block Address) to the device file offset. I mean if I want to write to the sector 5, there will be a LBA for it. So I can do lseek on my device and then write the data there. So how the mapping between LBA and device file offset can be calculated.
View 4 Replies
View Related
Feb 28, 2011
I am running Ubuntu 10.04, and i recently purchased an tandberg LTO-4 SAS tape drive. I want to access it and backup data on it. Do I simply just connect plug it into the server,and I should be able to backup/transfer data to the tape drive? Or are there intermediate steps before I can do that. Here are some results from commands that I have typed:
Quote:
ls /dev/tape/
by-id
Quote:
ls -lt /dev/tape/by-id/
total 0
lrwxrwxrwx 1 root root 9 2011-02-25 14:54 scsi-3500110a00145553e -> ../../st0
lrwxrwxrwx 1 root root 10 2011-02-25 14:54 scsi-3500110a00145553e-nst -> ../../nst0
[code]....
View 4 Replies
View Related
Sep 3, 2009
I created an ext3 partition to be able to share data or files between CentOS 5.3 and F11 (and possibly other distros...) on /dev/sda5. I created the folder under /mnt and edited fstab and it's mounting ok and it lets me write to the drive.
But it's only seeing the files I wrote to it in F11, not the files or folders I created in CentOS; not even the text files created in gedit. I read some messages on here, and made myself the owner of the folder (data2share) and rebooted and it's still not seeing the files.
Might it be because F11 is using ext4 and CentOS is using ext3 ?? To test that theory, I started my external usb drive that's also formatted ext3 and it's seeing those files just fine. So I'm stumped.
Here's the output from /sbin/fdisk -
Code:
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x8f97908e
Device Boot Start End Blocks Id System
[Code]....
View 1 Replies
View Related
Feb 9, 2010
i have installed nfs server on my redhat machine.when i want to mount shared data from client(suse)machine the following error occur. "mount.nfs: mount to NFS server '10.3.31.146:/home/usbtest' failed: System Error: No route to host" both machines ping each other successfully.
View 1 Replies
View Related
Dec 4, 2010
We want to fix our data folders structre in Samba, for example our folders would be like as Data/Group A/2010 /A.We want all our users can work only in folder A and no one can create any files in data, GroupA, 2010 folders. Similarly no one can delete these basic folders. However users can create further folders in A as required.
View 1 Replies
View Related
Jul 12, 2011
I've created quite a predicament with my desktop installation and would prefer to be able to salvage it instead of having to reformat/re-install Ubuntu.
Quite a lot happened and here's my best recollection:
- My Ubuntu installation stopped working and I could not get the desktop to load.
- I backup up my entire home directory by creating a zip file along with other small zip files. I used Alt + Del + F1 to get the CLI to do this.
- I then did different things trying to get the desktop to load.
- I did a apt-get upgrade, to try and get it to work; this was not sucessful.
- Working through several dependency issues I finally got sudo apt-get ubuntu-desktop upgrade to work, but it did not finish completely. I started to get out of memory errors. I am assuming this was because too much hard drive space was taken up by the zip files I had created
-I could not boot and do anything properly after that. Every attempt to modify the filesystem (to free up space) results in an error "Read Only File System". The root file system was not being mounted and I would see root@none on the CL
- Looking on the boot loader I now have Ubuntu 9.10 2.6.24-generic installed
- I burnt a new installation of Ubuntu 10.4 LTS
- Using Live CD I tried to see if I could free up some space and get the system back to more stable state,
However this was NOT sucessful. I tried to mount my drive by sudo mount -t ext3 <dev> <dir> but I keep getting the following error: error while loading shared libraries: /lib/libsepol.so.1: cannot read file data: Input/output error
View 2 Replies
View Related
Jan 22, 2011
I just downloaded Eclipse, and it is packaged as a compressed file. Within is a folder with the application plus configuration and any plugins et cetera. Should I simply put this in my /usr/bin folder? Is the bin path recursive, so that it will execute eclipse/eclipse when I simply write eclipse? All other files in there are simply that - single binaries, and no config-files or such.
Another possibility that occured to me is place the application in a separate folder, create a bash script that simply starts the application in the bin folder. But what folder would be good? I don't really want to contaminate my home folder with machine-wide applications...You might call me pedantic, but that is because I am. I just want to know what the "convention" is so to speak.
View 2 Replies
View Related
Jun 15, 2010
I am wondering if pthread could make that a single thread keeps the "mutex" all the time if the time it remains unlocked is very small.
thread1
{
while (1)
{
lock; do_task(); unlock();
[code]...
I experiment the thread2 never getting access to the mutex and never printing the nice message. I would expect that once thread2 calls "lock", it would get the mutex as soon as thread1 calls unlock() but it does not seem to be the case. If I add a sleep of some microseconds (100) in thread1 after unlocking the mutex, it solves the problem.
Does anyone know if this behaviour is normal? Is there a way to configure my mutex so that thread2 receives it when unlocked?I use
pthread_mutexattr_settype(&att, PTHREAD_MUTEX_RECURSIVE_NP);
pthread_mutex_init(&handle, &att);
to create my mutex. I am running ubuntu 9.04
View 3 Replies
View Related
Feb 15, 2010
locking mutex (phtread_t type) in a signal handler function (installed by function signal()) for Linux. It seems that if the mutex has been previously locked by another thread outside the signal handler function and then the signal handler function tries to lock it, the whole process hangs.
View 5 Replies
View Related
Mar 4, 2010
I am installing a custom 8.04 live disk (basically, a mirror of my whole system with user data intact, sans all non-OS files) from a USB key with remastersys for the .iso creation, and UNetbootin for the bootable USB on a brand new 120GB PATA WD HDD. Both do nicely so far, so I have a working livedisk to use until I need to install Ubuntu to the drive.
I had a pure linux box, but I need to add XP with dual booting now- I have to use Autodesk Inventor 2010 software for my college class on my laptop, so I don't drive 30 miles to use the 1 computer lab equipped with that software. I'm not new to Linux, but I am new to more in-depth partitioning. I've taken the lead and looked into things- read this good guide, among others:
HTML Code:
http://www.psychocats.net/ubuntu/partitioning and noticed that there is a way to more deftly use partitions so that personal files can be shared access and write between Windows and Linux partitions- with this:
HTML Code:
http://www.fs-driver.org/ Ubuntu is still my main OS, but being able to access all my media/data files between the 2 systems would be nice. Problem is, until now, I've put everything on a single partition because I didn't know better. Now I do, but am a bit confused with all the guides as to what's most efficient, especially in my case where full RAM speed is crucial to running a single program.
Here's what I know I need to do: 1. The Windows XP install I know needs from 20-30GB for Inventor 2010 LT to work well. I don't need anything else in XP spacewise- it's just being added for Inventor. 2. I'd like to create a separate /home partition for Ubuntu this time to save my user data, making future upgrades much more painless (I will be getting Lucid soon). How that works when upgrading, though, I don't know yet..
3. I'd like both OSes to share all my personal files (docs, pics, music, Inventor design files) if it is an efficient choice that works without problems.
4. Finally, because 2GB is minimum for Inventor to run decently, I need to maximize the speed of my RAM for it- from my reading, these so-called "swap" partitions can somehow be added for buffering this- people seem to sugguest the swap be half the size of the RAM for fastest speed, and some say add separate /usr or other partitions. I'm not clear on what would be most efficient for me.
I have limited HDD space- because of my laptop's BIOS, this single 120GB drive is the biggest I can get on my laptop, so efficient partitioning would make a huge difference for me. Before this, a 60GB HDD was in this. I'd like to see some added space for my data storage, but still keep things as fast as possible for Inventor when I use it, and Ubuntu.
View 3 Replies
View Related