64 Topics

Member Avatar for
Member Avatar for smith32

[CODE] sem_t w,r,s1,s2,s3; pthread_mutex_t m; int main(int argc, char* argv[]) { mutex and semaphores initialization ..... call threads.... wait until finish and cancel threads... clean threads and semaphores [I]exit;[/I] } void *reader(void *argv) { while(TRUE) { sem_wait(&r); sem_wait(&s1); pthread_mutex_lock(&m); ... read data..... pthread_mutex_unlock(&m); sem_post(&s1); sem_post(&w); } printf("Done read\n"); sem_post(&extra2); pthread_exit(NULL); …

Member Avatar for Abhineet.Ayan
0
172
Member Avatar for Pytho

Hi all Microsoft has what I want. When you write to their forums and you type the title for your thread, a list will appear under the input box. It looks like the image attached. Well, I have a MySQL database which contains a name field. There is something like …

Member Avatar for pritaeas
0
142
Member Avatar for besjana

Please can you help me to solve an exercise in Java ? Here is the exercise : Create e program in Java that shows an image in a panel. The program let the user to make 2 clicks repeated ( make first click and immediately make the second click. ) …

Member Avatar for zeroliken
0
182
Member Avatar for Santi1986

how many stacks does the kernel maintain/keep track of...say if there are 12 kernel threads and around 50 user processes??

Member Avatar for rubberman
0
197
Member Avatar for arya6000

Hello I have the following code for a WPF application here is the code Code from MainWindow.xaml.cs [CODE] public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void button1_Click(object sender, RoutedEventArgs e) { Thread[] threads = new Thread[3]; for (int i = 0; i < 3; …

0
86
Member Avatar for samad

this is my code and below are the notices that r shown in browser ..what can i do?? [CODE] FILE 1: new_user.php <?php require('header.php'); ?> <body> <?php require('sql_connect.php'); ?> <?php require('functions.php'); ?> <form method="POST" action="add_new_user.php"> Username: <input type="text" name="user_name" /></br> firstname: <input type="text" name="first_name" /></br> lastname: <input type="text" name="last_name" /></br> …

Member Avatar for Shamrocks
0
172
Member Avatar for swissknife007

[CODE] #include<stdio.h> #include<conio.h> void hello() { printf("\nHELLO\n"); } int main() { hello(); hello(); hello(); hello(); getch(); return 0; } [/CODE] If I run this code on a compiler,how many processes and how many threads will be running on the compiler and which ones? Does a duplicate function call consist another …

Member Avatar for gerard4143
0
183
Member Avatar for casey_sunako

Hi. Guys, I need some help. Does anyone know how to Call cross threads in vb.net while accessing the backgroundworker as well? I keep getting error everytime I run my program... Here is my code: [CODE]Imports System.IO.Directory Imports System.IO Public Class Video_to_Mp3 Public folderopen As String Dim ofd As New …

Member Avatar for GeekByChoiCe
0
353
Member Avatar for Fortinbra

My web application has the ability to process data from word docs and PDF files. We recently had a client who attempted to run files that are of a significantly larger size than anything we tested with. 50MB-500MB PDFs compared to our test files of 1MB-30MB files. If they don't …

Member Avatar for riteshbest
0
116
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 saqib_604
Member Avatar for kadamora

I'm making my first program that is using threads...the problem is that when I click the button that I created in windows form it never goes to the button click event in the debuger!!! I've read that that those threads should be background so i made like this [CODE]Thread sendcon …

Member Avatar for kadamora
0
170
Member Avatar for CrazyProgrammer

Hi, how does one end a thread when it is done eg i have a program the when u press a button it starts a thread, this thread performs a set of instructions and then when it is done it it finished how do you end a thread then when …

Member Avatar for Venjense
0
90
Member Avatar for toadzky

My program talks to a USB device over a serial connection. I have WMI ManagementEventWatchers watching for the device to be plugged in and unplugged. If I try to enable, disable, or change anything about the GUI from the event handlers for the WMI Events, I get a InvalidOperationException because …

Member Avatar for toadzky
0
231
Member Avatar for Galois77

Hello All, I have a question related to synchronization in java; there's more like a confirmation. Let's start with the simplified version of my class: [CODE]class MyClass { private List<MyObject> myList = new ArrayList(); public void addEntry(MyObject obj) { myList.add(obj); } public void removeEntry(MyObject obj) { myList.remove(obj); } public double …

Member Avatar for thekashyap
0
192
Member Avatar for 9w43

Hello, I have an error on my program, after hours of trial and error I couldn't fix it. I am trying to build a simple server which needs to have threads so more than 1 connection can take place. I don't know if I am doing the threads right, I …

Member Avatar for masijade
0
171
Member Avatar for iammirko

Hi, I am trying to learn winsock programming using online tutorials. This example is from the MSDN library, although modified. I have compiled it and it seems to be working fine for only one request. After handling a single request the server exits. I have read handling multiple request and …

Member Avatar for Ancient Dragon
0
315
Member Avatar for hanslim77

I'm trying to run audio in a different thread but I have no idea why but when I call wait(), my entire program seems to wait or hang.. not sure if it's deadlock since all it does is wait(), though if I set a time period, after that period it'll …

Member Avatar for hanslim77
0
209
Member Avatar for andy1977

I have a WCF service in which I have one method, It gets new live auctions from the database. It is called every second. For each auctions WCF creates new thread and start the auction. This thread updates database every second and after auction ends that thread gets close. However …

0
96
Member Avatar for xagutxu

Hello: I am trying to create an audio processor, and I have a program that creates some threads (in Windows). The "main" program creates the audio processor thread, and then creates the audio reader thread. I would like to know how the audio reader can tell the processor that the …

Member Avatar for Narue
0
241
Member Avatar for DarthMustard

Hi, I am writing a simple program modeling client/server interaction. I want the server to be capable of handling multiple connections. To implement this, I have been using _beginthreadex, passing references to sockets to the child thread. For example: [code]while(1) { SOCKET sClient = accept(ListenSocket, NULL, NULL); ... child = …

Member Avatar for thelamb
1
737
Member Avatar for geethasree

Hi All, this is my first query after joining the forum. I would like to know following points: 1. If I can create threads in constructor 2. If yes, can I use the same object / instance (which created this thread)in this thread to call other methods of the class …

Member Avatar for geethasree
0
2K
Member Avatar for blackrobe

Hey there, I'm currently using NetBeans 6.8 running Cygwin GNU Bash version 3.2.49(23)-release. I'm having a problem running my program that uses pthreads, mutexes, and semaphores. After it creates 1 to 3-4 threads, it returns a Segmentation fault. I ran the program on a computer running Linux (using NetBeans as …

0
115
Member Avatar for sarkar.manab

Can some one help me in find out which other threads are created as we start our main program, like "main" thread will be followed by "Finalizer" and then followed by "Reference Hanndler" etc. It may be System threads. But my questions is how i came to know and starting …

Member Avatar for sarkar.manab
0
96
Member Avatar for miraj0072004

hello friends, I am calling an external _ant_compile.cmd program from my java methods as [CODE] Runtime rt = Runtime.getRuntime(); Process p=rt.exec(thepath);[/CODE] but here, the external program starts, and starts proceeding, but the problem is this launch takes place without any relation to the original class...which means, once after i have …

Member Avatar for masijade
0
117
Member Avatar for twc2102

I am using Visual C++ 2010 and created a CLR EXE debug project and wrote a function, which I am able to call from main in my program. If I take the exact same code and put it in a dll, then I get a compile error from the line …

Member Avatar for twc2102
0
1K
Member Avatar for shazzy99

Hi, I've been trying to capture video from webcam using openCV functions and openGL for rendering. The code is working fine and I can acquire and display both the cameras. Now I'm trying to record the captured video's and saving them to a file using openCV createvideowriter object. I can …

Member Avatar for shazzy99
0
311
Member Avatar for P00dle

Ok, so I wrote a very simple programme, just to practice multithreading. I know it can be coded better, but I'm still learning about this, so please be lenient. This is my code so far: [CODE]package threads; // Create a thread import java.io.File; class threads implements Runnable { // This …

Member Avatar for P00dle
0
135
Member Avatar for Unitaren

Hello, This is my first post to the community. I have never really been one to ask of much help but I am stumped. I was asked to asked to write a word count program that received input from a scanner object. The input could consist of one or more …

Member Avatar for Unitaren
0
5K
Member Avatar for mpegjohn

Hi, I am running 3 threads that each start an ffmpeg process to extract 3 snapshots form a video file. I need to be able to call this method multiple times, with different video files. It writes the three snapshots to the system. However If I try to delete these …

Member Avatar for mpegjohn
0
315

The End.