64 Topics
|
|
Why do I always get the default filter of recommended every time I open dw? I am quite capable of decidling if I want a filter or not. How can I turn it off? |
|
I wrote an application using pthreads which had 5 threads. 4 of the threads filled up 4 buffers and once they had been filled the main thread would be combine these together. This was achieve using barrier so the main thread would wait until the 4 worker threads had reached … |
|
I'm totally new to c++ programming and I need to solve this problem: in the class 5 pupils got marks for the course informatics on a total of 30 points. these points have to be typed on the keyboard and have to be changed in percent. the average has to … |
|
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 … |
|
I've been wondering for the longest time why I don't get email notifications to threads to which I started or subscribed too ? |
|
|
Noticed that Moderator badge has been dropped. I don't really care about the others, but the Mod badge was useful if I had to put my Mod hat on. Now I'm a grumpy git just pretending to be a Mod. OK it's there if you're a thread starter, but not … |
I wanted to upload an excel file with one of my threads, but it is refused. Do I have to zip it first and if so, why? |
|
Hello! I'm new to programming and I'm trying to do a basic hotel application using threads in java. Here is what i've already done: //room class public class Room { private int idRoom; private int etaj; private boolean empty; public Room() { this.idRoom = 0; this.etaj = 0; this.empty = … |
|
I was following along to the following tutorial - [Derek Banas Java tutorial 18 - Threads pt2](http://www.youtube.com/watch?v=G2Xd5avyk_0) and as I decided to go over his tutorial series by following along in notepad++ and compiling with the command line, so that I can experiment and test things I'm unsure about, I … |
|
Hi everyone, I am writing some PDE code, and I am just starting to think about parallelizing it. The code is extremely parallelizable by both CUDA (at the lowest level) and regular threading at the higher level. Specifically, I am coding a matrix multiply, and the matrix is banded, so … |
|
One thread increases an integer named "counter" , and another decreases the same integer. Using synchronized statement on LockObject to control access to counter. If i understand correctly i have to use an Object reference. Can i use synchronized statement on counter somehow? public class Synchronized_Block_Demo { public static int … |
|
Lately I have seen several threads that people have "tagged" as intended. Why is *tagged* in quotes? Because instead of putting *keywords* into the tags box, users are describing the question they're asking in the thread, and thus creating tags that look this way: **Time zone** `how` `to` `find` `frame` … |
|
Hi, I have a working program and I need to answer the following questions: 1:where was polymorphism was used in this application? 2:identify where overriding or overloading was used in this application? I belive overriding is used by the Runnable method to override the run() method. Would that be a … |
|
**Please help me out** I am trying to do the following: "Create a program that calculates prime numbers from a certain number X to a number Y. Modify the program so as to run two threads at the same time. The first thread will start counting from X to Y … |
|
I see this example frequently and thought I'd give it a shot but I've got something unexpected happening with my Queue. I have multiple threads utilizing my producer class but the output doesn't show that it is being written to by each thread. protected Queue<ProductMessage> prodQueue = new ConcurrentLinkedQueue<>(); @Override … |
|
As C++ has nice read me's like, `C / C++ FAQ's and Practice problems`, `C++ Books`, `"Flushing" the input stream` , how about some read mes's in PHP forum. Its a widely used language like C++, so it would be nice to have some read me's. What do others think … |
|
i've just started learning the C# language and this is my first program to use threads. I don't understand why the consumer thread doesn't get called( only after the producer has stopped)and when it gets called it doesn't consume anything, also I've noticed that the majority of produced elements are … |
|
hi, for program to be concurrent i created 4 threads as below Thread th1 = new Thread(a1.run); Thread th2 = new Thread(b1.run); Thread th3 = new Thread(c1.run); Thread th4 = new Thread(d1.run ); th1.Start(); th2.Start(); th3.Start(); th4.Start(); how do i know when the threads are finised done with the work, … |
|
HI, How can I read from a txt file using threads in C#, regards |
|
What should be the output to the following code ? I am confused because I am getting a slightly different output everytime . Any other advise would also be appreciated . #include<iostream> #include<SFML\System.hpp> void apple_thread(void *data) { using namespace std; for(int i = 5 ; i<11 ; i++) { cout<<"I … |
|
public class Thread8 implements Runnable { Demo d; public static void main(String r[]) { new Thread8().disp(); } void disp() { d = new Demo(); new Thread(new Thread8()).start(); new Thread(new Thread8()).start(); } public void run() { d.fun(Thread.currentThread().getId()); } } class Demo { static long f=0; synchronized void fun(long id) { for(int … |
|
Here when I execute the program, the output I'm getting on all the tries is 342 (naturally first 34 prints together then 2 seconds later 2 prints). My doubts is that is the order of start() [x.start() followed by y.start()] important in order of execution? Shouldn't the output be 234? … |
|
Two doubts: 1. Placing run() inside main() generates "illegal start of expression error"? So why can't run() be placed inside main()? 2.With the above code I am getting the output as A C D B. Why B comes last is because of join(). But what I'm unable to understand is … |
|
I Have This Workers List: private List<Worker> buildWorkerList( Producer producer ) { List<Worker> workerList = new ArrayList<Worker>( 11 ); workerList.add( new WorkerImpl( "Garnett", producer ) ); workerList.add( new WorkerImpl( "Durant", producer ) ); workerList.add( new WorkerImpl( "Xavier", producer ) ); workerList.add( new WorkerImpl( "Daniel", producer ) ); workerList.add( new WorkerImpl( … |
|
I am in the process of creating a jackpot game. At the moment I am stuck trying to cycle through the different pictures and stop on a random picture for 5 different slots. So far I have this for animating: private void animatePictures() { Thread timer = new Thread() { … |
|
Hi! I'm trying to emplement the job queue. Somehow i can't initialize it: the queue is empty `Inline Code Example Here` //INCLUDES #include <stdio.h> #include <stdlib.h> #include <semaphore.h> #include <pthread.h> //GLOBALS pthread_mutex_t job_queue_mutex = PTHREAD_MUTEX_INITIALIZER; int i; #define N_threads 10 int val=0; //STRUCTURES typedef struct job { int data; struct … |
|
I'm trying to seem if(t3.alive) is not ever entered. It successfully goes through t1 and t2 if statment but skips over three. I've tried the do while, while (like seen). I would think if t3 is still alive the loop would still go then once it's not, its out but … |
|
Okay, first off, this is not a thread for an answer like "Use delegates", or the like. I know how to use them, but one time I forgot to use them, and when going over my code, it worked, and I've been wondering why for a while. http://screensnapr.com/e/xx68FK.jp[/img] The image … |
|
Hi, I'm trying to create a thread for running some tasks. I copied the code from an old console application (which compiles fine), but can't figure out why it's not working now. I have searched for the error code and came across this suggestion: "Are you passing the name of … |
|
[CODE=java]import java.util.Scanner; class Sum { private int value; public int get() { return value; } public void set(int sum) { this.value = sum; } } class Summation extends Thread { private int upper; private int lower; private Sum sumValue; public Summation(int upper, Sum sumValue) { if (upper < 0) throw … |
The End.