473,395 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

C# Threading Issue

Hello,

I am currently having an issue with the FileSystemWatcher class for an
application I am developing. I use the FileSystemWatcher class to
identify a change in a directory (i.e. a file has been added) and once
this event is captured then I make a call to another class which
implements calls to a camera SDK.

The issue I am having is that when using FileSystemWatcher to create a
new version of my class and start making calls to an asynchronous
camera capture() method, the call is made and then when check
has_captured flag, this is always immediately set to complete although
now picture has been taken. When I call to this class however from a
basic console application the call to the capture() method is made and
then the has_captured flag is only set once a picture has been taken
as I would expect.

I have therefore started to think it may have something to do with the
event thread that is fired when using the FileSystemWatcher class.

Can anybody provide any input to this issue.

Many thanks in advance,

Phil

Jan 30 '07 #1
4 2108
On 30 Jan, 16:58, "PhilBray" <PhilB...@gmail.comwrote:
I am currently having an issue with the FileSystemWatcher class
It may or may not be related to your problem, but if you search this
newsgroup for recent posts containing "FileSystemWatcher", somebody
else had a similar problem to you where the file creation event was
firing before the creating application had finished writing it.

Jan 30 '07 #2
Hi,

"PhilBray" <Ph******@gmail.comwrote in message
news:11**********************@h3g2000cwc.googlegro ups.com...
| Hello,
|
| I am currently having an issue with the FileSystemWatcher class for an
| application I am developing. I use the FileSystemWatcher class to
| identify a change in a directory (i.e. a file has been added) and once
| this event is captured then I make a call to another class which
| implements calls to a camera SDK.
|
| The issue I am having is that when using FileSystemWatcher to create a
| new version of my class and start making calls to an asynchronous
| camera capture() method, the call is made and then when check
| has_captured flag, this is always immediately set to complete although
| now picture has been taken. When I call to this class however from a
| basic console application the call to the capture() method is made and
| then the has_captured flag is only set once a picture has been taken
| as I would expect.
|
| I have therefore started to think it may have something to do with the
| event thread that is fired when using the FileSystemWatcher class.

It's possible, but IMO this depend of the camera you are using and how you
should comunicate with it. Also note that sometimes the FileSystemWatcher
fires more than one event for the same action from the file. I would also
check for this.

How you communicate with the camera?

Jan 30 '07 #3
On Jan 30, 5:15 pm, "Bobbo" <robin.willi...@choicequote.co.ukwrote:
On 30 Jan, 16:58, "PhilBray" <PhilB...@gmail.comwrote:
I am currently having an issue with the FileSystemWatcher class

It may or may not be related to your problem, but if you search this
newsgroup for recent posts containing "FileSystemWatcher", somebody
else had a similar problem to you where the file creation event was
firing before the creating application had finished writing it.
Hi Bobbo,

I resolved the issue but it was related to the build path I was using
when using the FileSystemWatcher application. For some reason I was
not getting all the required SDK DLL's brought into my build directory
at runtime.

All is now good but thanks for the fast response.

Phil

Jan 31 '07 #4
On Jan 30, 8:15 pm, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA
laceupsolutions.comwrote:
Hi,

"PhilBray" <PhilB...@gmail.comwrote in message

news:11**********************@h3g2000cwc.googlegro ups.com...
| Hello,
|
| I am currently having an issue with the FileSystemWatcher class for an
| application I am developing. I use the FileSystemWatcher class to
| identify a change in a directory (i.e. a file has been added) and once
| this event is captured then I make a call to another class which
| implements calls to a camera SDK.
|
| The issue I am having is that when using FileSystemWatcher to create a
| new version of my class and start making calls to an asynchronous
| camera capture() method, the call is made and then when check
| has_captured flag, this is always immediately set to complete although
| now picture has been taken. When I call to this class however from a
| basic console application the call to the capture() method is made and
| then the has_captured flag is only set once a picture has been taken
| as I would expect.
|
| I have therefore started to think it may have something to do with the
| event thread that is fired when using the FileSystemWatcher class.

It's possible, but IMO this depend of the camera you are using and how you
should comunicate with it. Also note that sometimes the FileSystemWatcher
fires more than one event for the same action from the file. I would also
check for this.

How you communicate with the camera?
Hi,

I resolved the issue but it was related to the build path I was using.

Thanks for the response.

Phil

Jan 31 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Zuel | last post by:
Sup everyone! I wrote this code for Tomcat appserver but I am told from an associate that it has threading issues. The basic idea is to store a read only data table for everyone to use. It...
19
by: Jane Austine | last post by:
As far as I know python's threading module models after Java's. However, I can't find something equivalent to Java's interrupt and isInterrupted methods, along with InterruptedException....
0
by: James R. Saker Jr. | last post by:
I've got a: "start server thread > Queue object, start server thread <> Queue object, start parsing client < Queue object" application that's got me puzzled. Probably an easy threads issue, but...
77
by: Jon Skeet [C# MVP] | last post by:
Please excuse the cross-post - I'm pretty sure I've had interest in the article on all the groups this is posted to. I've finally managed to finish my article on multi-threading - at least for...
3
by: ELO | last post by:
Hi all Every week, I need to get two files on a remote server. I have developped a C# Windows Service with two System.Threading.Timer to do this task For the first one, the delay (TimeSpan...
13
by: John | last post by:
I've got some reasonably complex business logic in my C# code, in a class called by a ASP.NET page. This takes around 3-4 seconds to execute. It's not dependent on SQL calls or anything like that....
4
by: JimD | last post by:
Is this safe? Any pitfalls? I have done threading in regular C# apps, but haven't had a needs to do threading in ASP.Net, until now. The issue I have ran into is this: Our corporate portal...
2
by: WXS | last post by:
When I see things in .NET 2.0 like obsoletion of suspend/resume because of the public reason MS gives of they think people are using them inappropriately.. use mutex, monitor and other...
0
by: R K | last post by:
I am delevoping a Scheduler module whose functionality is to load the Scheduled Item Details every day (For this I have created a System.Threading.TimerCallBack with Timespan 1 day) in a stack. Once...
126
by: Dann Corbit | last post by:
Rather than create a new way of doing things: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html why not just pick up ACE into the existing standard:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.