129 Topics

Member Avatar for
Member Avatar for jkon

I wanted to post something in Daniweb for a while but I didn't had anything new. Recently I decided to write a new implementation for websocket connections client side using Shared Web Workers. Shared Web Workers are supported today by most browsers for desktop but few for mobile devices , …

Member Avatar for jkon
2
447
Member Avatar for saurabh.mehta.33234

I am trying to run the below concurrency code: import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; public class TestThread { public static void main(final String[] arguments) throws InterruptedException { ExecutorService executor = Executors.newSingleThreadExecutor(); try { executor.submit(new Task()); System.out.println("Shutdown executor"); executor.shutdown(); executor.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException e) { System.err.println("tasks interrupted"); } finally …

Member Avatar for JamesCherrill
0
419
Member Avatar for can-mohan

Hi, I would linke to know what is the best way to synchronise the shared memory segment. is threads usage are also advisible whie synhcronising the shared memory segement. in what circumstances we should use threads or semaphore to synchronize the memory segment.

Member Avatar for rproffitt
0
454
Member Avatar for Mr.M

Hi Guys. I'm trying to suspend a process by it name, but I found the sample that demontrate this using ProcessId. The problem is that I don't know the process ID of the process I want to suspend/resume. [Here is a sample I used.](https://social.msdn.microsoft.com/Forums/en-US/cdde6cef-3971-40a6-b4dd-02db963868ce/suspend-an-application?forum=vbgeneral)

Member Avatar for Mr.M
0
443
Member Avatar for Reverend Jim

Sometimes there are functions you want your program to perform in the background while you are busy doing other things. For example, if you are building a picture viewer application you may not want to wait until thumbnails are generated before getting on with the business of viewing the pictures. …

Member Avatar for Reverend Jim
3
4K
Member Avatar for iFrolox

Hi, I got multiple threads in different classes created in this manner: private ThreadStart someName_TS; public Thread someName_Thread; public void someName() { someName_TS = new ThreadStart(someNameThread); someName_Thread = new Thread(someName_TS); someName_Thread.Start();} } private void someNameThread() { while(!Shutdown) { //Do heavy work } } The heavy work is set to a …

Member Avatar for iFrolox
0
396
Member Avatar for -ordi-

[CODE]# -*- coding: utf-8 -*- from PyQt4 import QtGui from PyQt4.QtCore import * import sys import os class VideosToMp3(QtGui.QWidget): def __init__(self, parent = None): super(VideosToMp3, self).__init__(parent) ''' Labels and GUI ''' extension = QtGui.QWidget() download_label = QtGui.QLabel("Enter YouTube video URL:") self.download_line_edit = QtGui.QLineEdit() file_label = QtGui.QLabel("Enter file name (optional):") self.file_line_edit …

Member Avatar for Ha
0
632
Member Avatar for Pobunjenik

So I'm building this pretty simple top trumps card game as part of an assignment. I have the game logic built, the swing GUI is in place and I plan to do all the calculation on the server app and have it update the client up with the game's state, …

Member Avatar for Pobunjenik
0
683
Member Avatar for Tycellent

Hey guys, I'm interested in learning about simple multithreading in C++ for Windows. Does anyone have any reccommended tutorials/links thats quite good?

Member Avatar for dinad578
0
408
Member Avatar for Mr.M

Hi Dw I'm trying to create a server that will handle simultaneous connections from clients and for simplicity I've decided to save data to the text files, it not one text file but there are many text files which will be located on the server. The clients (written in VB5.0) …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Dziri_1

//I want to start a thread that set postion of a la lable here is part of the code t = new Thread(bar); t.Start(); public void bar() { while (true) { label2.Location = new Point(this.label2.Location.X + 10, this.label2.Location.Y); Thread.Sleep(1000); if (this.label2.Location.X > this.Width) { label2.Location = new Point(200-this.label2.Width + 10, …

Member Avatar for Naravia
0
210
Member Avatar for dhatsah

Quick question, the answer is eluding me on the internet. Which is unusual. When we reference and call a sub/function from a class is it automatically started on a new thread or will it join the main thread? Cheers in advance.

Member Avatar for Ancient Dragon
0
207
Member Avatar for Dr_Freeman

Greetings. I have a bit of situation here. I'm using symfony2 and facebook SDK to set up a web service for my IPhone and Android applications. The problem is that the background work can take quite a while. User is first redirected to facebook login page where he can proceed …

Member Avatar for chrishea
0
417
Member Avatar for diafol

Have a look at this thread... http://www.daniweb.com/web-development/databases/mysql/threads/466095/create-.mdf-file-from-mysql My machine shows seems to reformat this to plain text. So just plain page of text. Using Chrome/W7. Anybody else?

Member Avatar for diafol
0
305
Member Avatar for 123pythonme

I created a thread as I was struggling with an assignment I was given. I was told today that I mustn't share my coding with anyone and was wondering if there was anyway to delete my thread. my thread is http://www.daniweb.com/software-development/python/threads/465305/python-prime-number-code-not-working

Member Avatar for Mike Askew
0
269
Member Avatar for Mathias_1

I'm trying to create a program where I can print output to my console application and entering test without being override. Is there anyway to accomplish this? Here is my simple code showing my issue: ` #include <iostream> #include <thread> #include <Windows.h> void myThread() { while (1) { std::cout << …

0
164
Member Avatar for ktsangop

Hello! I would like some help with a piece of java code that i'm having problem. I have to make simultaneous tcp socket connections every x seconds to multiple machines, in order to get something like a status update packet. I use a Callable thread class, which creates a future …

Member Avatar for ktsangop
0
516
Member Avatar for rgrs2007

Hi I am new to this forum and i was just wondering if the following scenario is implementable. Suppose a thread is reading a file and dividing it into chunks of data(lets say in the form of arraylist, where each line corresponds to a value in arraylist). Each chunk of …

Member Avatar for JamesCherrill
0
295
Member Avatar for rgrs2007

I am working on a simpler version of the following question: http://www.cs.ucf.edu/courses/cnt4714/spr2011/prog1.pdf and have simplified the problem in the following manner: SO: input pipe is PIPE4 and output pipe is PIPE0 S1: input pipe is PIPE0 and output pipe is PIPE1 S2: input pipe is PIPE1 and output pipe is …

0
154
Member Avatar for cirbab4

I am very new to thread. However I would like to make 2 threads, Thread A and Thread B. When a button is clicked Thread A starts and so does Thread B. Thread B shows a loading image and disables users from clicking any buttons whilst Thread A executes some …

Member Avatar for JOSheaIV
0
184
Member Avatar for mesbahuk

I have a Java code block like following: public TcpConnection(TcpSocket socket, long alive_time, ITcpConnectionListener listener) { init(socket,alive_time,listener); start(); } For the conversion in C#, When I try to replace the `start()` method with `System.Threading.ThreadStart()`, it gives an error. How can I start a thread in C#?

Member Avatar for ddanbe
0
279
Member Avatar for cool_zephyr

hey could anyone please tell me how to create a dialog from a background thread that is not a UI thread in Android?? something like this.. Thread t=new Thread(new Runnable() { @Override public void run() { Thread innerThread=new Thread(new Runnable() { @Override public void run() { /////***** i need to …

Member Avatar for peter_budo
0
373
Member Avatar for srivardhanms

Hi, I have two threads A and B. Thread A prints only odd numbers. Thread B prints only even number. I want to synchronize it in such a way that on the screen I get continues numbers. How can I do that? I was thinking of using sockets. Thread A …

Member Avatar for Yerbantherack
0
253
Member Avatar for LastMitch
Member Avatar for LastMitch
0
241
Member Avatar for nerdygirl118

The assignment is to implement the Banker's Algorithm using pthreads and mutex locks. We implemented the Banker's Algorithm and it works fine. When we began implementing the pthreads and mutex locks we ran into problems. We know that each process is a thread, and that the mutex lock is acquired …

Member Avatar for deceptikon
0
153
Member Avatar for joseph.lyons.754

Hi Guys I was just wondering how you stop the combo box from displaying different instances of the same value. In the combo box i have villages and towns names e.g doolin. onli thing is i have many businesses from doolin on the database so when i pull the town …

Member Avatar for joseph.lyons.754
0
212
Member Avatar for karandeepmalik

I was looking at the possible solution to synchronise a bounded buffer ( like queue) using condition variables and think that we probably need two condition variables to correctly implement the synchronisation, one condition varaible will have a queue where the consumer thread(s) will be waiting to see if the …

Member Avatar for rubberman
0
220
Member Avatar for mido22

i'm looking for code of posting a new thread box like that found in vbulltin forums or any box like that which has basic settings as(Bold , italic, underline , add image using url, alignment , fonts type , color , size , adding codes) i don't need it for …

Member Avatar for LastMitch
0
157
Member Avatar for vegaseat

This Python snippet shows how to control a VPython visual 3D sphere with Tkinter GUI toolkit button clicks.

4
3K
Member Avatar for fyra

Hi people. I wonder how I can free the pthreads' allocated memory? #include <pthread.h> #include <stdio.h> #include <stdlib.h> #define NUM_OF_THREADS 10 void* print_thread_id(void* tid) { printf("Greetings from thread %d\n", (*(int*)tid)); pthread_exit(NULL); } int main(int argc, char* argv[]) { pthread_t threads[NUM_OF_THREADS]; int status, i; int* n_thread; for(i = 0; i < …

Member Avatar for Banfa
0
276

The End.