129 Topics
|
|
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 , … |
|
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 … |
|
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. |
|
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) |
|
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. … |
|
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 … |
|
[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 … |
|
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, … |
|
Hey guys, I'm interested in learning about simple multithreading in C++ for Windows. Does anyone have any reccommended tutorials/links thats quite good? |
|
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) … |
|
//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, … |
|
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. |
|
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 … |
|
|
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? |
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 |
|
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 << … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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#? |
|
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 … |
|
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 … |
|
|
Will there be any rating score of a thread in the future? What is the **Pro** or **Con** of it? |
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 … |
|
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 … |
|
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 … |
|
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 … |
|
This Python snippet shows how to control a VPython visual 3D sphere with Tkinter GUI toolkit button clicks. |
|
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 < … |
The End.