Programming :: Read Tutor About Multi Threading, But Not Getting Correctly

Mar 1, 2010

I am new to Programming. I would like to learn some multi threading in C. how to start. I read tutor about multi threading, but not getting correctly.

View 2 Replies


ADVERTISEMENT

Programming :: Will Multi-Threading Improve Performance?

May 18, 2011

So I have built a program that takes a picture from two cameras every second and converts them both to jpeg format. The problem is that currently it takes ~2 seconds to convert a single raw photo to jpeg format, thus every second I add another raw photo (30 MB) to ram waiting to be converted to jpeg. So, theoretically the conversion to jpeg is running on a single core with hyperthreading, would I see better performance running the exact same process (a program pulling from a queue and converting to jpeg) running as a single process, or two concurrent processes? (both processes running on the same core, (so 1 thread on one clock cycle, the other on the other... (or one thread running on 1 core and the other on another core. What other steps would you take to improve the performance so there would no longer be a race condition?

-Currently using QT

View 5 Replies View Related

Fedora :: Mplayer Builds With Video Acceleration And Multi-threading Support?

Sep 4, 2009

I thought this may be of interest, so I'm sharing. I've built some experimental mplayer packages for Fedora 11 and Rawhide (x86-32 and x86-64 arches) with shiny new features. Aside from being very recent snapshots, one of them includes support for hardware video playback acceleration via VDPAU and VAAPI, and the other includes support for multi-threaded playback (so you can split the decoding load across multiple cores).

The playback acceleration can definitely be used on NVIDIA adapters (from the GeForce 8xxx series onwards) using the proprietary driver (not, unfortunately, nouveau). Also on Intel Poulsbo (GMA 500) adapters, using my packaged version of the native driver for that chipset (link is in the blog post). VDPAU acceleration is also allegedly possible on S3 Chrome 530 GT and S3 Chrome 540 GTX adapters using S3�s own driver, but I haven't had the chance to test that. Multi-threaded playback can be done on any system, but only really makes sense on those with multiple processors (cores).

Full details of where, how and why are in my blog post:[URL]..

View 14 Replies View Related

Red Hat :: TCL With Non-threading / Error This Version Of TCL Was Compiled With Threading Enabled?

Sep 13, 2010

I am trying to stand up an IDS box based on RHEL 5.

When I issue the command ./sguild I get the following response:

ERROR: This version of TCL was compiled with threading enabled. Sguil is not compatible with threading.
SGUILD: Exiting.

View 4 Replies View Related

General :: Awk: Read Dan Manipulate Data In Multi Files From A File?

May 26, 2011

I wonder capability of awk to manipulate data in consecutive multi files by read one batch file.for example I have files: data1.dat, data2.dat,data3.dat and listfile.txt

cat data1.dat
23 34 54
43 45 76

[code]...

View 4 Replies View Related

General :: Disabled Vet Looking For A Tutor To With Script Writing?

Feb 12, 2010

My name is Barry and I have lost my job as a plumber because of the ecomony. I have been going to school for two years now at Ivy Tech in Indiana. Myself, along with other vets in my Linux System Administrator Class are in need of a tutor for this class. I go to school in Valporaiso, Indiana. The V.A. is willing to pay $60.00 per hour per person. We are all are willing to be tutored as individuals or as a group.

Tutoring 5 or so people at a time is $300.00 an hour, if you know what I mean! There are no tutors in this area we know about. This problem has been a on going problem with the school. You would have to sign up with V.A. so that you could get payed. You would get paid once a month. There are serveral vets in this area that need help and it would generate alot of money for someone out of work. You must be qualified by having experience, you don't have to be a teacher with a teaching degree.

View 4 Replies View Related

Ubuntu Multimedia :: Files Not Being Read Correctly In Media Player?

Jan 20, 2011

I am not sure what is happening with my music, but it's driving me mad and making me pull out my hair. My ID tags are not being read correctly through through both Rhythmbox and Banshee, but my tag editor, dBpoweramp, and Ubuntu properties reports the information correctly. All of my music is stored on another computer stream via the network. For example, I have an album by X Japan label as this:Track: Break the DarknessArtist: XAlbum: I'll Kill You EPYear: 1985

But banshee breaks up the album into two different albums, and on top of that, Banshee see it as X Japan, but reads it as X for the artist. And it's not just this album, it happens to a lot of my albums, sometimes they are missing tracks or mislabel or missing cover art, etc, etc, but only within the media player. Why is this happening and has anyone else notice this?Ubuntu 10.10 x64Banshee 1.8.0Rhythmbox 0.13.1Music streamed over network

View 9 Replies View Related

Red Hat / Fedora :: Format For Server & RAID Setup For Multi Platform Read/write/access?

Jun 23, 2011

I'm looking to set up a server with attached mass storage device and tape autoloader to run linux. It's set up under Windows at the moment. Goal is to have users, connecting from individual workstations and laptops, backup their data to the linux server. On their personal machine, some users run linux, some MacOS, some Windows. I plan to set up the 5 500 GB drives as RAID5. I understand that if setting up as software raid the format is "physical volume for RAID". Under this setup, will Windows users be able to read/write and function as expected? I can't assume only linux user access.

View 3 Replies View Related

Programming :: VTALRM In Multi-threaded Programs?

Apr 20, 2011

I ran into an inconsistency in handling timers (VTALRM) between AMD and intel platforms with threads. My understanding was that the timers are per process. I discovered I must call setitimer in the thread on intel though. AMD allows me to make the setitimer call once in the main thread as expected. The code below demonstrates the issue. I must add the code in the INTEL define for it to work properly on intel cpu's. Am I missing something dumb??

[Code]...

View 4 Replies View Related

Programming :: Create A Multi Selection Menu?

Sep 18, 2010

I am creating a program that need menu with multi selection option for shell (CLI).I am using of Bash scripts.something that will look like that:

Menu:
[ ] option 1
[x] option 2

[code]...

View 2 Replies View Related

Programming :: Multi Dimensional (3 Array) In Python

Jul 28, 2010

I do a lot of scientific work - mainly in C/C++ but want to do some of the calcs in python, however I am finding it a problem with the lack of dimensionality. I frequency have a list of n particles and a multi-dim array for each particle and want to be able to access directly any component with ease. How best to go about this...

my prop = [n][x][y][z]

I might need a particular value and then to update that. I do not want to have to deal with lists etc etc as this feels rather cumbersome, adding, removing etc. There must be an easy way.

View 2 Replies View Related

Programming :: PHP - Sort Multi Dimensional Array

Apr 30, 2010

I have a multi-dimensional array like so:

Code:
Array (
[0] => Array (
[0] => Eleven
[1] => NumberEleven
[2] => 11 )
[1] => Array (
[0] => Twelve
[1] => NumberTwelve
[2] => 12 )
[2] => Array (
[0] => AnotherEleven
[1] => Eleven,Again
[2] => 11 )

I need to sort it by array[ $key ][ 2 ] so that it is sorted like so:
Code:
Array (
[0] => Array (
[0] => Eleven
[1] => NumberEleven
[2] => 11 )
[1] => Array (
[0] => AnotherEleven
[1] => Eleven,Again
[2] => 11 )
[2] => Array (
[0] => Twelve
[1] => NumberTwelve
[2] => 12 )

I've looked at the php array docs the closet thing I found was array_multisort which won't work for my above requirements, does anyone have any insight to how to sort this way?

View 3 Replies View Related

Programming :: (PHP / XML) Sorting Through Multi Dimensional Array

Sep 17, 2010

I am parsing through XML documents with a PHP script and creating an array because, as far as I know, I can manipulate arrays better than the features DOM gives me. That part is not as important, though. The array it produces though is multi-dimensional, but somewhat inconsistent. If I have the following XML:

PHP Code:
<domains> <domain>
<title>google.com</title> <bookmarks>
<bookmark>maps.google.com</bookmark>
<bookmark>news.google.com</bookmark>
<bookmark>mail.google.com</bookmark>
</bookmarks> </domain> <domain>
<title>bankaccount.com</title>
<bookmarks> <bookmark>login.bankaccount.com</bookmark>
</bookmarks> </domain> </domains>

To call the first bookmark from the first domain, it would be:
PHP Code:
$array['domains']['domain'][0]['bookmarks']['bookmark'][0]
To call the first bookmark from the second domain, it would be:
PHP Code:
$array['domains']['domain'][1]['bookmarks']['bookmark']

The problem is, I want to simply call bookmarks through a simply 'foreach()' or 'for()' function and the lack of consistency might be a problem, but the fact that some levels have a '0' array key and others do not is causing a problem.

View 1 Replies View Related

Hardware :: ATI Multi Card Multi Display Xinerama Composite

Jun 24, 2011

I have an ATI Radeon HD 3300 on-board video chipset, and an ATI Radeon HD 4350 PCI card. What I want is to have both displays available from one mouse/keyboard. I want to play media on one and have the other as my main desktop.The problem is that with Xinerama enabled, KDE desktop effects do not work (KDE says XComposite and XDamage are not available, even though I explicitly enabled them as extensions in the xorg.conf file), and performance is quite bad. Without Xinerama enabled, performance is great, desktop effects work great, but there's a lot of trouble with full-screen video, and the KWin window manager does not apply in the second display (although I can run a second instance of KWin on :0.1).

View 2 Replies View Related

Programming :: PHP - Sorting Multi Dimensional Arrays By One Column

Mar 17, 2009

I just started programming in PHP so I haven't figured out how to do this yet, but I have a multi-dimensional array that I need to sort by one column. That's fine...but I need the sort to ignore case! Right now I have it sorted by 'name' (the other column is 'uid').

The problem is that by the default the sort is case-sensitive so the array looks like this:
Code:
Apple 4015
Banana 4011
Cherry 4045
avocado 4046

I want to be able to sort the the 'name' column in a case-insensitive manner so that the array actually looks like:
Code:
Apple 4015
avocado 4046
Banana 4011
Cherry 4045

How to accomplish this? Just FYI I'm not actually sorting the PLUs for fruits...but it was a simple example. I'm actually doing this for a Facebook application.

View 2 Replies View Related

Programming :: Access To Multi-Partitions Disk Image

Jan 30, 2010

I have a 2GB file which is a dd image of a block device. The block device (a USB-connected flash memory) contains multiple partitions, and therein lies the problem. I want/need to access the various partitions in the image file, but need to do this without actually using a physical flash memory device. If the image was that of a single partition, I could simply mount it on a loop device, and access the filesystem as necessary. However, I can find no kind of virtual block device upon which to write/mount the image.

I've searched the net exhaustively for anything that would seem to allow me to do what I need, but without even a sniff of success. Sadly, I have seen bits of information that suggest "you can't get there from here". Even the outstanding dd tutorial by AwesomeMachine on LQ didn't help. Anyone know of a kind of virtual block device on which a multi-partition image can be written and mounted? Or any other way I can access individual partitions (with various filesystem types on each) and then re-assemble them back to a single image?

View 2 Replies View Related

Programming :: Multi Dimensional Arrays In C Of Variable Size

Apr 15, 2010

I am curious if there is a way to describe and use variable sized multi-dimensional arrays in C using pointers. I mean, for 1-dimensional array e.g. I can use the following piece of code:

...
int i , N;
int *array;
scanf("%d", &N);
array = (int*) malloc(N*sizeof(int));
for (i=0; i<N; ++i) array[i] = i; // Assigning values to the array
for (i=0; i<N; ++i) printf("%d ", array[i]); // Printing the assigned values
free (array);
...

But what about the two dimensional array[N][M] ? I guess I have to use a double pointer e.g: int **array. But how exactly? Note that I use C90 and not C99.

View 2 Replies View Related

Programming :: Multi-line Find - Replace With GnuWin32 Sed?

Apr 26, 2009

I would like to have a script that will do a search in an XML file for a specific block of XML code and replace it with a different block of XML code using the Windows build of GNU Sed 4.1.5.

Here's the text I want to find:

Code:

And here's what I want to replace it with:

Code:

There is however a lot of stuff in there that would mess up sed, and the one example from the sed FAQ (from the Sourceforge site) that looked promising and easy enough to figure out (4.23.3. Try to use a block of "literal strings") fails with this error message: sed: file blockrep.sed line 18: unterminated `s' command

Anyone got any ideas, or even an alternate program that can do this? (Preferably one that I can automate.)

View 4 Replies View Related

Programming :: Fork()ing Multi Child Process In C - Stuck

May 12, 2011

i got basic knowledge about creating a single child from a parent using fork(). But when it comes into creating multiple children, i am simply stuck. I am trying to create two processes from a parent and it would wait for both two processes to finish. my attempt is as below

[Code]....

View 3 Replies View Related

Debian :: Using VNC In A Multi-user / Multi-system Network

Mar 21, 2011

Anyone successfully using VNC client on a Mac to control a Debian server?I have the vncserver setup on the Debian machine properly. But I'm having problems connecting to it from both a PowerMac running Tiger and a MacBookPro running leopard.I can connect no problem from a machine running Slack12.2, have not setup port forwarding on my router to connect remotely yet.My Debian machine is running the latest stable release of squeeze with KDE4.I originally tried this with RealVNC Enterprise for OSX but I'm not gonna buy it so I need another alternative after the 30 day trial ends as they have no free version for OSX.
The situation is that I do freelance graphic design on the PowerMac with Cinema4D and Photoshop so I spend most of my time on that machine which is located in my home studio in my attic. Aside from the MacBook and a Dell desktop(family machine)all my other machines and network hardware are in the basement. So to go from the attic to the basement everytime I need to do something on another machine is not practical, and the only other machine I need to access on a regular basis is the Debian box in the basement, this makes the most sense.

I also have a 14 year old living in the house and he's fascinated by all this and will meddle in anything he gets the chance to so all the Linux machines and network hardware need to be behind lock and key.

View 6 Replies View Related

Programming :: Developing A Multi-language 'project' Using Subversion / Eclipse?

Jun 30, 2009

I'm starting work on a little project that uses alot of languages separately (i.e no interaction between languages. Does anyone have any experience like this and could pass on some recommendations as to best practises? I'm thinking either have a eclipse-project for each language stored under a single svn repo, or individual projects for each problem.

View 1 Replies View Related

Programming :: Multi File Recursive Folder Search And Replace?

Aug 3, 2010

I'm wanting to mod some PHP files across a hierarchy and thought I'd drive it with find + grep + xargs

I built up a command line which I was confident would do the job, but now can't save the results.

First I tried this:

Code:
find . -name *.php | xargs grep serialize | cut -d: -f1| sort -u | xargs sed -i s/serialize/serialise/g
but that didn't work:
Code:
sed: illegal option -- i
so I thought I'd try using
Code:

[Code].....

View 10 Replies View Related

Programming :: Simple Multi-threaded/forked TCP Listener/server?

Aug 12, 2010

For quite some time now, I've been trying to implement a multi-threaded or forked TCP server to perform the following action:1) Listen for new connections on all ip addresses on a specific port.2) Wait for a new connection to arrive3) When a new connection coms in, fork or thread to free up the listening process so it can go back to #2.When handling a client after it's been forked/threaded4) Get the connected client's ip address.5) Perform some in-house processing;6) Read the data sent from the client (checking for http connections)7) Perform some more processing;8) Write some data back to the client based on the above processing9) Close the socket/thread/forkI've tried implementing an solution similar to the multi-threaded example show here http://perl.active-venture.com/pod/p...-sockets.html; as well as looking at the CPAN solutions Net:aemon and POE::Component::Server::TCP but these don't seem to give me the information needed.The active-venture solution provides me with what I need, but randomly exits without reason/error and when attempting to change the 'for' loop to a 'while' loop, it keeps throwing up different errors.

View 2 Replies View Related

Programming :: Split Multi Line Record Into Multiple Files With Awk?

Nov 11, 2009

I have a large file 'NS0923.csv' with data like the following. There are two records in this multi-record sample.

Code:

E60898,4578910,03/06/09,BEN BOYD RD,61,82,,,127,3,,52000.3046.001,3155,4.00,,PLT,1356,1.00,05/06/09,Y,Y,0551
,,,,,,,,,,,,4057,1.00,CLEAN CAR SHARE SIGN,LAB,0551,1.00,,,,

[code]....

2. I still have to create a file 'transaction.csv' that should retrieve data from $13 - $15 with the identifying column $1. Required output:

Code:

E60898,4057,1.00,CLEAN CAR SHARE SIGN

3. And finally another file 'quantity.csv'. Retrieving data from $16 - $18 with identifier $1. Required output:

Code:

E60898,PLT,1356,1.00
E60898,LAB,0551,1.00
E60898,LAB,3065,1.00

[code]....

View 10 Replies View Related

Programming :: Parse The File Correctly With Python

Nov 27, 2010

I'm currently curios with my python program which the basic goal is to parse the character in mytestfile;let's see the code

Code:
f=open('/home/andrewraharjo/Desktop/snort.log','r')
j=f.read()

[code]...

View 3 Replies View Related

Programming :: Rsync Script Not Working Correctly

Jan 2, 2010

I have a cron job that runs overnight for a rsync script that backups my home directory to a external hard disk that is connected to the computer via usb 2.0. I also output the results to a log and follow it via tail -f command from a terminal, to monitor it.

Here is the script:
Code:
#!/bin/bash
# backup data on a daily basis via rsync and a cron job
echo
echo backup started `date` >>/home/user/scripts/backup/backuplog
echo
rsync -avh /home/user/ /media/Linux_ext3/
echo
echo backup complete `date` >>/home/user/scripts/backup/backuplog
echo
echo disk used: `du -csh /media/Linux_ext3` >>/home/user/scripts/backup/backuplog
echo
echo disk free: `df -h /media/Linux_ext3` >>/home/user/scripts/backup/backuplog
echo

Two things
- The rsync is doing a complete mirror of my home directory to the usb drive. For example, say I have a .txt file at the root of /home/user. It gets copied over. However I delete the .txt file the next day and if I go to /media/Linux_ext3/, the .txt file is still there.
I was always under the impression that rsync would mirror the two directories, correct?
-For my log, I think it is creating an entry, I think, for each file. Again, was under the impression that rsync would only copy over files that have be updated, correct?

View 5 Replies View Related

Programming :: Timer In Socket Programming - Wait For X Sec After Read() And Then Disconnect The Client Connection

Mar 8, 2011

I have a server listening on incoming client connections. Once the client establishes SSL connection with the server, the server waits on read() from the client. Only Client can disconnect the connection. I want to have a timer in the server program to wait for x secs after read() and then disconnect the Client connection.

View 3 Replies View Related

Programming :: Equivalence Classes Based On Field Values And Multi-key Hashtable?

May 12, 2010

I've got a set of objects (all of the same type). I'm trying to think of a good way to divide it into equivalence classes, with equivalence of two objects defined as meaning a specified set of attributes are equal for both objects. More concretely, I've got:

- a Java class with around 50 fields
- a bunch of instances of the class

I want:

- to divide the instances into a few sets
- in each set, each instance has field 1 - field 5 equal to fields 1-5 of the other instances in the set.

The method I've come up with is to generate a hashcode for each instance based on the hashcodes of fields 1-5*, and map the hashcode to one of my sets. Ignoring problems with potential hashcode collisions (which I'm expecting to be too rare to worry about for now), does that sound reasonable? It seems simple enough, but I'm wondering if there's a simpler method I haven't thought of.

* I'll generate the hashcode using a method based on Eclipse's generic hashcode method, which looks like this:

Code:

public int hashCode() {
final int prime = 31;
int result = 1;

[code]....

View 5 Replies View Related

Programming :: Perl Child Processes Become Zombie On A Multi-core Processor?

Apr 11, 2011

I have written a simple script which has to find required patterns from a bunch of files ( where each file is around 2 GB each,which contain the output of seq 1 10000000000000) on an 8 core machine.I am current forking 6 child processes which run simultaneously on 6 cores of the processor & have to search for the required pattern in 6 different files & inform the parent process when a pattern is found using a PIPE.

The problem is,when a child process is done reading a text file looking for a pattern,it is becoming a zombie process.It exits cleanly when i put a $SIG{CHLD} = "IGNORE"; in the script.Can any one tell me whats going on & how do i improve the communication between child and parent processes?

Code:
#!/bin/perl
use strict;

[code]...

View 3 Replies View Related

Programming :: Change Correctly The Script For The Tarfile Module?

Sep 17, 2010

I've fixed an tarball damaged and now obtain many file with the same name into; I tried to create a script based on a previous originally based on the "zipfile" module:

original:

Code: #!/usr/bin/env python
import os
import sys
import tarfile

[code]....

but obtain error becouse the tarfile has not the attribute "infolist" how i could change correctly the script for the tarfile module?

View 3 Replies View Related







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