Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP critical section: uniqueness question
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01160316
Message ID:
01160424
Views:
9
Mark,

I'm pretty sure there's only one global CS structure involved. Otherwise this single function wouldn't work.

CS objects can be nested but it gets tricky with lock counts revving and hte potential for deadlocks going up drastically. It's best to keep critical sections to short, short blocks.

But if you really need multiple CS objects why not make an API call to the 4 CriticalSection APIs? (actually it's probably easiest to do this in C code via DLL or FLL)

+++ Rick ---

>I need help understanding how SYS(2336) critical section functionality is provided by VFP. My particular question is this: Is there only a single VFP critical section object that exists at one time per process (e.g., a process such as IIS using apartment model threading with a VFP COM MTDLL), this regardless of where and how many times in one's code a SYS(2336,1) is asserted,? For example, somewhere in my code:
>sys(2336,1)
>IF !FILE(SomeFile)
>  DO something to create the file
>endif
>sys(2336,2)
and then somewhere else in code running as part of the same MDTLL (possibly even invoked by the MTDLL as an "external" FXP module), there is another critical section:
>sys(2336,1)
>IF !FILE(SomeOTHERfile)
>  DO something to create SomeOTHERfile
>endif
>sys(2336,2)
>In this situation, while the first critical section is being executed to check for FILE(SomeFile), is the other unrelated critical section that checks for FILE(SomeOTHERfile) also blocked from other threads until the first critical section is exited?
>
>Taking the question a bit further, what if my IIS app uses two different VFP COM MTDLL's (each compiled as separate DLL)? Does this change the possible number of "concurrently" executing critical sections?
>
>Thank you!
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform