Hi,
How can I make a sub to be executed only one at the time in a multithreaded
environment?
Eg, I have "server" thread,s that does printing, problem is when several
server threads running at the same time, the Crystal Reports Com Object
crashes, Guess its not thread safe..
How can I change so my "PrintReport" sub only run one at the time, if
another thread is requried to use it, it need to wait until the first is
done.
( I see how I can do it with a global boolean and some do while loops, but
is there any built in functionallity for this kind of operations?)
- Fredrik 2 949
Frederik,
The only thing from this article is that I know that it exist.
(I did not need it) http://msdn.microsoft.com/library/de...ronization.asp
I hope this helps?
Cor
"Fredrik Melin" <me*@no-spam.dacsa-remove-this.net> Hi,
How can I make a sub to be executed only one at the time in a multithreaded environment?
Eg, I have "server" thread,s that does printing, problem is when several server threads running at the same time, the Crystal Reports Com Object crashes, Guess its not thread safe..
How can I change so my "PrintReport" sub only run one at the time, if another thread is requried to use it, it need to wait until the first is done.
( I see how I can do it with a global boolean and some do while loops, but is there any built in functionallity for this kind of operations?)
- Fredrik
Use SyncLock Statement
Private Sub PrintReport()
SyncLock "PrintReport"
'Printing
End SyncLock
End Sub
"Fredrik Melin" wrote: Hi,
How can I make a sub to be executed only one at the time in a multithreaded environment?
Eg, I have "server" thread,s that does printing, problem is when several server threads running at the same time, the Crystal Reports Com Object crashes, Guess its not thread safe..
How can I change so my "PrintReport" sub only run one at the time, if another thread is requried to use it, it need to wait until the first is done.
( I see how I can do it with a global boolean and some do while loops, but is there any built in functionallity for this kind of operations?)
- Fredrik This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: dixp |
last post by:
I'm new to writing multithreaded apps and I have a design question. I
have a winforms app and a class which has a method that does processing
which is time intensive. I want the user to be able...
|
by: mihai |
last post by:
What does the standard say about those two? Is any assurance that the
use of STL is thread safe?
Have a nice day,
Mihai.
|
by: Robert Zurer |
last post by:
Can anyone suggest the best book or part of a book on this subject. I'm
looking for an in-depth treatment with examples in C#
TIA
Robert Zurer
robert@zurer.com
|
by: sarge |
last post by:
I would like to know how to perform simple multithreading.
I had created a simple form to test out if I was multithreading
properly, but got buggy results. Sometime the whole thig would lock
up...
|
by: tommy |
last post by:
hi,
i have found a example for multithreading and asp.net
http://www.fawcette.com/vsm/2002_11/magazine/features/chester/
i want to speed up my website ...
if my website is starting, they...
| |
by: Rich |
last post by:
Hello,
I have set up a multithreading routine in a Test VB.net
proj, and it appears to be working OK in debug mode and I
am not using synchronization. Multithreading is a new
thing for me, and...
|
by: Sam |
last post by:
Hi,
I have a serious issue using multithreading. A sample application
showing my issue can be downloaded here:
http://graphicsxp.free.fr/WindowsApplication11.zip
The problem is that I need to...
|
by: sandy82 |
last post by:
Whats actuallly multithreading is ... and how threading and
multithreading differ .
Can any1 guide how multithreading is used on the Web .. i mean a
practical scenario in which u use...
|
by: Pradnya Patil |
last post by:
hi ,
I am trying to draw ' html div-tag ' on the screen which will
resemble a rectangle through vb.net code.
I want it to be drawn faster...so I introduced multithreading
using Threadpool. I...
|
by: Ray |
last post by:
Hello,
Greetings! I'm looking for a solid C++ multithreading book. Can you
recommend one? I don't think I've seen a multithreading C++ book that
everybody thinks is good (like Effective C++ or...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |