121 Topics

Member Avatar for
Member Avatar for AutoPython

[B]!USING PYTHON 3.1![/B] Hello DaniWeb! Today I'm going to be posting a [B]simple[/B] threading tutorial. First of all, what is threading? Well, threading is just another way of doing a side task without interrupting the main program. Now here's a simple example. Let's say we are going to make a …

Member Avatar for nytman
3
1K
Member Avatar for fabio.bozzo

Hi to all, I'm using the WIA Aut. Library [url]http://www.microsoft.com/downloads/details.aspx?familyid=a332a77a-01b8-4de6-91c2-b7ea32537e29&displaylang=en[/url] , trying to capture photos from 5 digital cameras (Nikon D90) USB-connected to my pc. Now, I partially achieved my goal, what I do is: - loop through the attached devices, connecting to every camera; - fotocamera.ExecuteCommand (WIA.CommandID.wiaCommandTakePicture) ; - …

Member Avatar for vince8290
0
522
Member Avatar for crownedzero

Still playing with multi-threading and Prod-Con, at this point I've been at this for days. Would love some help debugging; thanks in advance. http://pastebin.com/jhHB9kTY - Main http://pastebin.com/BZSspf3x - Consumer http://pastebin.com/ndzAADJz - Producer http://pastebin.com/p7YdzH1D - Product http://pastebin.com/rxs3WzDT - Message http://pastebin.com/JR5ywgz1 - Utiliy 2 Producers, 4 Consumers Essentially Producers push a message …

Member Avatar for crownedzero
0
243
Member Avatar for khalidshakar

What is the way that need to be implemented in java to make a server broadcasts a voice to multiple clients, instead of broadcast voice only to one client? for example I am doing a server which can broadcast voice to multiple clients at the same time, now my server …

Member Avatar for khalidshakar
0
511
Member Avatar for rahul.ch

public class Thread7 implements Runnable { public static void main(String r[]) { Thread t = new Thread(new Thread7()); t.start(); public void run() { System.out.println("C"); System.out.println("D"); } System.out.println("A"); try { t.join(); System.out.println("B"); } catch(Exception e){} } } Query1: On compiling this program I get "illegal start of expression" error pointing to …

Member Avatar for delta_frost
0
271
Member Avatar for Zeref

Hi guys, So I'm busy writing an application that needs to update a list from the web after a certain amount of time. main.py file class Gui: def ...... def ...... def ...... def on_update_click(): update() app=Gui() Gtk.main() So when the program loads up, user will click the update button …

Member Avatar for Zeref
0
310
Member Avatar for malrofo

Being on a core i5 sandybridge mobile processor, I have the option to have dual core, hyperthreading, or both enabled. Which should be disabled to lengthen the battery life and still have decent performance?

Member Avatar for sheikhali449
0
188
Member Avatar for david56connor

Hi there, I have a piece of code that I made to handle the joining of 'characters' in to a 'raid' on a game. The program refreshes a page to check if the 'raid' is available, if it is, it 'forms' the raid and 'joins' the characters. The joining process …

0
135
Member Avatar for JOSheaIV

So awhile back I came here asking for help trying to read in data from a webpage, more specifically the HTML. I was running into an issue where the data wasn't actually being read (as if it hadn't loaded in). I had to put the program aside for awhile as …

Member Avatar for JOSheaIV
0
290
Member Avatar for Grenwood

Hey all, I was hoping I could get some advice on designing the proper threading for our project. A little background info - our company does simulators of complex electrical/mechanical systems. These simulators could have fuel systems, electrical systems, pneumatic pressure systems, etc. I suppose you can just think of …

Member Avatar for Grenwood
0
222
Member Avatar for sah

there are three methods called in a backgroundworker_dowork() event in c# .net 4. I want to execute three methods synchronously. that is, 2nd method will execute after 1st method is fully executed and 3rd method will execute when 2nd method is fully executed. because 2nd method can exetue properly only …

Member Avatar for Momerath
0
403
Member Avatar for MsBear92

[CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * MainMenu.java * * Created on Feb 22, 2012, 7:28:37 PM */ package f1carracing; import java.awt.Color; import java.awt.Graphics; import java.awt.Image; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JOptionPane; /** * * @author …

Member Avatar for NormR1
0
384
Member Avatar for smarty_t2

Hi, I have a MDIParent and forms that i want to show as child. But because each individual child performs heavy tasks I want each child to have it's own thread. here's what I am trying to do... [CODE] void showStartPage() { Form1 p = new Form1(); p.MdiParent = this; …

Member Avatar for Momerath
0
278
Member Avatar for Tellalca

Hey guys, I am playing with the .NET 4.0's new class Parallel. I tried to open files in a directory and calculate the total bytes of them. However when I run the code, I get a different result every time. Can you explain me the problem I have? [CODE]using System; …

Member Avatar for Momerath
0
205
Member Avatar for denizen08

I have a project that requires us to perform matrix multiplication via multi-threading, using the Windows API. I've got the basic code running and everything is well under sane/ideal conditions. But if my input matrices go beyond 10x10 the program ends up failing on WaitOnMultipleObjects(...) and runs the main thread …

0
118
Member Avatar for mahesh113

I want to learn multithreading in C++. somewhere on internet I got a piece of code using popen() function of stdio.h. I just wanted to know that if this function helps in creating the new threads or it doesn't come under multithreading. Please guide me in multithreading.

Member Avatar for L7Sqr
0
246
Member Avatar for sleepybug

I'm trying to do some socket programming in java. what i have is, i've written this program to create a server and client on my local machine and make separate two threads for socket input and out put in [B]Se.java[/B] file. Similarly two separate threads for socket input and output …

Member Avatar for JamesCherrill
0
1K
Member Avatar for bilal_fazlani

I am trying to create a a splash screen... I have attached the image file..please have a look.. the splash screen performs a diagnostic procedure and displayed the results in a multi-line label.. I have used another thread to write msgs as results in label.. and its working as it …

Member Avatar for TechSupportGeek
0
361
Member Avatar for Ratte

I am designing an application which communicates with another device via a serial port. My application buffers the received binary data until the data is valid/of known format, does some processing and then writes back a response. I understand this model is known as the consumer/producer model. The issue I …

Member Avatar for Ratte
0
239
Member Avatar for CSloan7597

Hey everyone. I have recently decided to try and learn how to use java Sockets for client/server communication, as well as swing and threads, etc. and have (pretty much) completed a small client server application. The application is basically a syntax-highlighting notepad, a client swing GUI which connects to a …

Member Avatar for CSloan7597
0
286
Member Avatar for Saidar

Hey everyone, I've been struggling with this problem for hours now and I have read and tried every example I could find but did not find a solution to my problem: I have a DLL written in C#. The DLL export function calls three functions: PrepareData(): Heavy calculations ComputeNN(): Mild …

Member Avatar for Saidar
0
229
Member Avatar for smith32

I'm trying to do the third writer/reader problem with semaphore (as mention on wiki). But it's not working properly. First 16-element array seem to work properly. But after first, it got wrong. Even though I think I'm almost there, I can't find the error at all. My code is as …

0
142
Member Avatar for smith32

I don't get it why my threads can't perform properly for writer/reader problem. I think something with the semaphore. but can't solve and online can't help me too. [CODE] semaphore mutex, read, write; void *reader(void *argv) { char buffer[200]; int readNo, i=0; do { sem_wait(&read); sem_wait(&mutex); sem_getvalue(&read, &readNo); fgets(buffer, sizeof(buffer), …

0
96
Member Avatar for divin757

Hi, I have a custom httphandler (HttpUploadHandler.ashx) which is used for handling requests from a file uploader. It collects all the files from a client then fires a thread to do some processing on the files. When large amounts of files are added it will throw 'Thread was being aborted' …

0
122
Member Avatar for notuserfriendly

Hello, first this is not a homework assignment so please respond whenever you have time as a speedy solution is not exactly needed. I have been learning C# recently from a microsoft book and had an idea of a program i want to make. Basically i want to be able …

Member Avatar for notuserfriendly
0
212
Member Avatar for kytro360

I am trying to run the following code in a thread but I keep getting this error: [QUOTE][QUOTE]Cross-thread operation not valid[/QUOTE][/QUOTE] for both listboxes. Heres the code I am using: [CODE] try { for (int i = 0; i < listBox4.Items.Count; i++) { listBox4.SetSelected(i, true); listBox5.SetSelected(i, true); listBox4.SelectedItem.ToString(); string[] details …

Member Avatar for nick.crane
0
249
Member Avatar for slasherpunk

[CODE]class MyThread1 implements Runnable { Thread t; MyThread1() { t = new Thread(this);//create a Thread t.start();//activate the thread } public void run() //override run() of Runnable { int i; for(i =0; i< 1000; i++) System.out.print("*"); } public static void main(String args[]) { MyThread1 m1 = new MyThread1(); int i; for(i …

Member Avatar for JamesCherrill
0
170
Member Avatar for aragonnette

[CODE]import os import urllib from datetime import datetime import workerpool class DownloadJob(workerpool.Job): def __init__(self, fa): self.fa = fa def run(self): f = open(self.fa + '.txt','w') f.write('Example Note.......') f.close() pool = workerpool.WorkerPool(size=5) def workfile(): range1 = 51 range2 = 102 fam1 = 555 fam2 = 833 ranges = range2 -range1 fams …

Member Avatar for aragonnette
0
209
Member Avatar for bangor_boy

Hi, There is a small blogging system where a user posts small blogs and they are time stamped, if this system was expanded into a distributed environment the main issue I can for see is with so many people using the system then posts will go out off order, the …

Member Avatar for bangor_boy
0
141
Member Avatar for machine91

I want to have two threads with a queue exchanging data (in the form of lists) between the two threads. However, at the moment I cannot fathom out how to write the code simply for taking the first list from the queue, processing it(which I have written the function for) …

Member Avatar for Gribouillis
0
248

The End.