1320 byte By
djodra at 2007-12-5 22:13:59
Hi,I am developing a dll in C and I have one problem that I don't know how to solve... An external application invokes my dll by calling the function:int calculateParameters(int, int)I need to return to the application the value "OK" indicating that the passed parameters are correct as soon as...
725 byte By
shahin at 2007-12-4 23:57:12
Hello AllI have a quite general question about Hyper threading in windows and how it effects the speed of a program and ....My limited understanding is that Hyper threading is a way of simulating a "Dual processor" . It is also for some operations to be performed at the same time ( am I right).I hav...
New question on PostThreadMessage & shared memory I tried the functionality of PostThreadMessage and mapping file (shared memory)on a console test harness and they work fine.However, when I copy my testing code to an NT service, both of them seem no longer work. Should PostThreadMessage work with an...
690 byte By
menny_ed at 2007-12-3 19:26:00
Hello,i'm programming a multithreaded communication application. Some of the communication operations are being hold in a a shared (for all threads) synchronized queue. the synchronized queue is using c++ 'CRITICAL_SECTION' handle (using the 'EnterCriticalSection' and '...
971 byte By
Gyannea at 2007-12-1 0:35:05
I seemed to have found out the hard way that I have to have a separate message loop to create a window in a thread. This is a terrible discovery since its the last thing I want to do is to burden this critical thread with a message loop...I want to keep it exclusively for handling sound data and DS...
i write a server/client program (chat)<br/> From now. I don't know how to handle Multi client. Multithreading must be exactly what i need.<br/> But how. any useful metarial for me u guy ? (about socket and multithreading)
109 byte By
verifier at 2007-11-27 0:19:32
Can a critical section be locked multiple times by the same thread? (As long as it is unlocked as many times)
I'm writing code in C++, and I have 3 classes. 1) Memory 2) Producer 3) Consumer.The Memory class has N blocks of memory; it provides a public interface for Read() and Write() blocks of data. It's thread-safe because of mutex.The Producer class is a thread, will keep Write() data to differ...
577 byte By
Abalfazl at 2007-11-25 11:39:22
Hello frineds!it is said:Foreground and Background ThreadsBy default, threads are foreground threads, meaning they keep the application alive for as long as any one of them is running. C# also supports background threads, which dont keep the application alive on their own terminating immediately on...
Please help me a simple example of Mutithreading.<br/>I donot know how use the mutithreading in MFC or VC++
Please help me a simple example of Mutithreading.<br/>I donot know how use the mutithreading in MFC or VC++
470 byte By
ironroot at 2007-11-25 11:33:32
Hi all;I need to figure out how to creat some binary semaphores to control two types of threads. Thread type one add a value to a buffer and thread type two wants to remove a value from the buffer. I want to prevent type one from adding a value to the buffer when the second type is removing a value...
95 byte By
Arjay at 2007-11-25 11:30:45
I just wrote another article on multithreading. Is it appropriate to announce it in this forum?
206 byte By
tangjun at 2007-11-25 11:27:51
I need to send 256 bytes over serial port without any interrupt, it will take less than 500 ms, but any context switch will fail the task. Is it possible to make this short period of time no context switch?
Hi all. Does TerminateThread have to be inside the same funtion as CreateThread does in order to terminate properly? Thanx in advance!
1200 byte By
mnopups at 2007-11-25 11:21:47
Hi,I have a VB form with a RichTextBox defined on it. My program needs to import a data file and based on that data file, it will make various web service calls. At the completion of each web service call, an additional text string is appended to the RichTextBox control. I am calling me.refresh foll...
820 byte By
HTS at 2007-11-25 11:20:53
Hello, I am creating a thread (let's call it thread B) from within another thread (thread A) , and saving the thread handle returned by AfxBeginThread. Before returning from thread A, I wait for thread B to terminate, using WaitForSingleObject with the thread handle. Problem is: if thread B...
196 byte By
MFCQuery at 2007-11-25 11:20:32
Hi,<br/>Please give a sample to use thread in c++. Without thread main application dont response to user. It looks like program is hang. If i use a thread then main application will responce.
1843 byte By
dp_76 at 2007-11-25 11:13:39
HiFrom the main thread of my NFC based SDi application, i am creating a UI thread. Now from within the UI thread, i am creating a worker thread that does a very crucial job.This worker thread has the tendancy to hang in certain situations.To handle this hang sitaution, i wait on this worker thread f...
848 byte By
rgalopo at 2007-11-25 11:12:47
Hi all !Im developing a multithreading C# application in which one I invoke several web service methods in the same machine. Those web services have been developed with java / Apache web server, and I cant change them.The multithreaded application has a heavy CPU percent usage.It runs perfect in W20...
100 byte By
ameliaj8 at 2007-11-25 11:12:04
Is there any issue with calling _beginthreadex more than once for the same thread until it succeeds?
I have a processor intensive application that breaks up it's work into different scenarios that are processed on two threads to make maximum use of the processor - a Pentium D (which has a dual core).However, I'm finding that sometimes the two threads run at vastly different speeds (i.e. o...
438 byte By
cpplinux at 2007-11-25 11:09:32
Hello,I'm looking for a small and clear example in c++ of 2 threads that are using the same queue. The queue is the one of the c++ STL library. Program 1 pushs requests in the queue and program 2 get these requests and process them.Do I need to lock the queue when one of the threads is using it...
Here is the source code of my C++/ME app. When I run it I can use "Windows Task Manager" to see that thread HANDLEs are leaking.#include "stdafx.h"#include <omp.h>public __gc class TestClass{public: void ThreadProc() { int sum = 0; #pragma omp parallel for reduction(+:sum) for ( int i = 0; i...
969 byte By
DeepT at 2007-11-25 11:04:08
I have two threads, one of them needs to run as fast as possible(because timing is very important) while the second thread is an expensive thread to run.The problem is that thread 1 and thread 2 have some objects in common. Traditionally I would just lock the object before using it. The issue w...
131 byte By
Abalfazl at 2007-11-25 11:02:47
Hello !<br/>It is said:<br/>"The basic unit of schedule is generally the thread"<br/>May someone explian about this?
485 byte By
avi123 at 2007-11-25 10:52:33
Hi,Suppuse I have the following functionstatic int staticIntX = 2;int inc(){ staticIntX++; return staticIntX;}What are the possible outputs for this function if 2 different threads are calling it?I understand that there are 3 possible answers:2,22,33,3the thing is that I do no...
472 byte By
Yijie at 2007-11-25 10:51:58
Hi all,Do need a favour here. I would like to monitor an application and kill it if it is hang and regenerate it. However, not able to find relevant code. I'm able to get the kernel and user time by "getprocesstime". But not able to monitor the CPU usage (not able to get idle time) to kill the...
766 byte By
chee0007 at 2007-11-25 10:50:23
Hi guysFrom what i have learnt, a static function cannot reference to outside variables directly except variables that is declared inside the static function itself. So by calling another function that actually do all the thread procedures, I can change and manipulate variables directly without usin...
By default, do multithreaded apps in windows/linux take advantage of multiple cores? So if I run an app that has 2 threads, will they balance out on separate cores (assuming they're equally used at that point) Or do apps have to be written specifically for this?
I'm trying to make a thread class for easy implimentation when writing programs, this is my code: namespace RSlib{ class RSthread { private: bool running; //set to true when thread is started, and set to false when stopped int thr_id; // thread ID for the newly created thread p...
Hi, I have a problem using the CRITICAL_SECTION: I have a thread that access to a list locking a criticalsection, the data are inserted in the list intercepting a message coming from a popup menu, the problem is that when the function try to add an element in the list and the critical section is loc...
199 byte By
visame at 2007-11-25 10:42:44
In Visual C++ Programming,these 4 concepts confused me:<br/>Thread,Process,Task and Event<br/>What is the difference between them?<br/>What books should I read and reference to?<br/>THANKS!
1586 byte By
Ky. at 2007-11-25 10:41:48
Hi guys,Im not sure I am using the corect terminology, since Im pretty new to MFC programming. Sorry for that.I created an object of a wrapper-class from an OCX libray (included with class _myObjectClass : public COleDispatchDriver).As opposed to other classes in this library and what "OCX" suggests...
97 byte By
aneird at 2007-11-25 10:40:34
There are no such tools that monitor threads?<br/>can i khow which thread is higher by thread id?
I noticed some code examples use _beginthreadex or beginthread.I have been using CreateThread All this time. What is the difference between the 2 ? uintptr_t _beginthread( void( *start_address )( void * ), unsigned stack_size, void *arglist );uintptr_t _beginthreadex( void *security, uns...
I'm having a really hard to trying to understand threading. It seems that all the sites I've been to trying to comprehend it, do it all differently. Is there any 1 easy, normal way to do threading? Maybe there's some things I should read up on before I get into it? I really want to un...
Dear sir,I have developed a routine in my package that is When I going to carry forward data from current year to next year. My Progress Bar is working properly but Label Capion property is not displaying of the carry forwared records.Actually, I keep the label control in Do While Loop And wanted to...
Hi I am trying to figure out how to pass a parameter to a Thread . Specifically char*. I might not be explaining correctly, so here are some snippets of my code. My main looks like thisint main(){ ThreadManager tm; tm.launchThread (&tm); while(...
Hi ; I tried asking this question in another section and didn't find the answers useful to solving this problem . So I'll post it hear and hope I get luckier. I need to launch a thread and monitor when it ends before launching another thread. If the new thread is launched before the old t...
1855 byte By
Hermit at 2007-11-25 10:19:13
Hey folks,Suppose I have one thread which constantly reads from a structure and another which only occasionally modifies it. Since the reading thread is performance critical, I'd rather not have to acquire a lock every time the structure is read, so I've come up with the following strategy...
Hi, My company is writing a test harness in MFC to test out the Cantata telephone switch. we keep on running into issues when we are running the test harness with a lot of threads, ie >=40 threads. Attached is a screen shot of the assertion error that keeps on popping up. It complains about C...
Hi I have a thread in my code. My thread code is similar to the thread format seen below - but it does a number of things and holds on to critical resources. My thread actually does microsoft speech - each thread says a new phrase. In testing, I discovered, that I absolutely have to wait until my...
353 byte By
chee0007 at 2007-11-25 10:06:52
Hi,I am new to multi-threading, and with our present technology with dual core processors, what kinds of setup can optimise multi-threading efficently?Can visual c++ or .NET API programs running on Window XP/2K platform do multi-threading efficently on a multi-processor system(dual core) like what a...
169 byte By
mdv at 2007-11-25 10:05:53
Hello,<br/>Is there a way to immediately wake up a thread that was put to sleep by calling the Sleep function with some big value?<br/>Thanks in advance. Denis
Hi all, I'd appreciate your help with this one because I think I'm out of my depth!I've got 2 threads running in parallel, both using separate instances of a class (in theory) but the behaviour seems like both threads are accessing the same instance of the class. Everything works fine...
i want to pass a struct as the parameter to my thread function.typedef struct tagTHREADPARMS {CWnd* pWnd;CEvent* pKillEvent;CEvent* pOutputEvent;CMultithreadingTestDlg* pDlg;//error here} THREADPARMS;i got plenty of syntax errors, such as:error C4430: missing type specifier - int assumed. Note: C++...
264 byte By
uaYola at 2007-11-25 9:51:24
Need to implement file downloading from internet using multithreading. May i call InternetOpen and InternetConnect in each of my threads or better to do it one time and use handle in different threads. How to do for BETTER PERFORMANCE?<br/>Thanks?<br/>PS. And why?
hi, i wrote a mfc dialog that's running a worker thread i want to terminate it from outside.in CMyTestDlg: public CDialog{static bool STOP;//a shared variable to signal the thread functionstatic UINT __cdecl Start();CWinThread* pThread...in the cpp file, i have a OnBnClickedButtonStart() and O...
1165 byte By
Czy at 2007-11-25 9:47:58
Hello,I've been stumped on this problem at work for a week. It is my first exposure to multithreaded C++ programming, and I am completely frustrated at how difficult it is to do something so simple.My task is to write a command-line test app for an API i have written (on a linux platform, RH7)...