Non-Reentr​ant VI executing in different Process Stacks
I am creating a DLL which can be called by several different processes on a machine at the same time. If I have a non-reentrant VI in the API, do the same restrictions apply between processes as if they were in the same process? For example, if I call "Get Shorty.vi" which is a non-reentrant VI from 2 places in the same process, at the same time, the first call will start executing, and the second call will wait till the first call is done. When called from 2 different process stacks, there is supposed to be total seperation of memory windows, so logic tells me that this restriction would not apply if that same VI were called from 2 different processes.
The catch is that the VI Library installed by the run-time engine is used by both processes as well. Would this, in effect, cause the same behavior between 2 calls to the same VI both in process and out?
Thanks for any help you can provide. This is not a easy to describe concept, so feel free to ask for clarification if needed.
CyberTazer
Software Systems Engineer
I understand that the memory spaces are supposed to be completly seperate. The question is that if 2 processes call the same function in the same dll at the same time... will one process have to wait on the other process to finish before being allowed to execute? My feeling on this is no, it would not have to wait, but I am hoping that someone out there has a more difinitive answer.
There is no shared memory mechanisms set up in this vi.. ie for persistant data between execution processes. I am not even sure if this is possible with LV dll's, but I thought I would throw that in there since I know it is possible in general.
Thanks again for your help guys... keep em comming. Hopefully this will help clear up other peoples perceptions on how dll execution is handled in LV if we can nail this down a bit more.
CyberTazer
Software Systems Engineer
Similar Messages
-
Hi,
I am trying to prevent someone from submitting the same information twice in quick succession on my Tomcat web application before the first submit action has completed.
Here is basically what my code looks like now:
String email = getEmailAddressOfSubmitter();
synchronized (email) {
// Process data that has been submitted
// This processing needs to finish completely before
// this block is executed again for this same email
This is preventing other threads from entering this synchronized block until it has completed, but it looks to me like the same thread entering this method again with another request is allowed to go through, because the thread already has the lock on this email address object.
This is causing data to be saved twice because in the short time between when I check if a record already exists in the database and when a new one has been saved another request sneeks in and also saves a record.
How can I prevent the same thread from entering this block again with another request until processing has finished for this email?
I suspect it has something to do with non-reentrant locking, but I don't understand a word of what I've read about it so far.
Thanks in advance,
EvertI don't know if this is the problem with your
program, but what you describe is possible: in Java
(differing from POSIX threads) a thread can access a
single lock (a synchronized method) more than once.
It's called reentrant locking.I assume that in practice this can really just happen if I have a method that calls itself. In my case with a web application, I assume the thread would complete one request completely before starting with the next http request. Other threads might interject, but the same thread should finish one request before starting the next.
I've done what BinaryDigit suggested and synchronized on email.intern() instead of just on email, and it looks like that did the trick. After 6 years of Java programming, I've forgotten that two strings are not necessarily == when they are equal. It's time for me to grab my beginner Java books again! -
One query taking different time to execute on different environments
I am working on Oracle 10g. We have setup of two different environments - Development and Alpha.
I have written a query which gets some records from a table. This table contains around 1,000,000 records on both the environments.
This query takes 5 seconds to execute on Development environment to get 200 records but the same query takes around 50 seconds to execute on Alpha environment and to retrieve same number of records.
Data and indexes on the table is same on both environments. There are no joins in the query.
Please let me know what are the all possible reasons for this?
Edited by: 956610 on Sep 3, 2012 2:37 AMBelow is the trace on the two environments ---
-----------------------Development ------------------------------
CPU used by this session 1741
CPU used when call started 1741
Cached Commit SCN referenced 15634
DB time 1752
Effective IO time 7236
Number of read IOs issued 173
SQL*Net roundtrips to/from client 14
buffer is not pinned count 90474
buffer is pinned count 264554
bytes received via SQL*Net from client 4507
bytes sent via SQL*Net to client 28859
calls to get snapshot scn: kcmgss 6
calls to kcmgcs 13
cell physical IO interconnect bytes 165330944
cleanout - number of ktugct calls 5273
cleanouts only - consistent read gets 5273
commit txn count during cleanout 5273
consistent gets 202533
consistent gets - examination 101456
consistent gets direct 19686
consistent gets from cache 182847
consistent gets from cache (fastpath) 81013
enqueue releases 3
enqueue requests 3
execute count 6
file io wait time 1582
immediate (CR) block cleanout applications 5273
index fetch by key 36608
index scans kdiixs1 36582
no buffer to keep pinned count 8
no work - consistent read gets 95791
non-idle wait count 42
non-idle wait time 2
opened cursors cumulative 6
parse count (hard) 1
parse count (total) 6
parse time cpu 1
parse time elapsed 2
physical read IO requests 181
physical read bytes 163299328
physical read total IO requests 181
physical read total bytes 163299328
physical read total multi block requests 162
physical reads 19934
physical reads direct 19934
physical reads direct temporary tablespace 248
physical write IO requests 8
physical write bytes 2031616
physical write total IO requests 8
physical write total bytes 2031616
physical write total multi block requests 8
physical writes 248
physical writes direct 248
physical writes direct temporary tablespace 248
physical writes non checkpoint 248
recursive calls 31
recursive cpu usage 1
rows fetched via callback 23018
session cursor cache hits 4
session logical reads 202533
session uga memory max 65488
sorts (memory) 3
sorts (rows) 19516
sql area evicted 2
table fetch by rowid 140921
table scan blocks gotten 19686
table scan rows gotten 2012896
table scans (direct read) 2
table scans (long tables) 2
user I/O wait time 2
user calls 16
workarea executions - onepass 4
workarea executions - optimal 7
workarea memory allocated 17
------------------------------------------------------ For Alpha ------------------------------------------------------------------
CCursor + sql area evicted 1
CPU used by this session 5763
CPU used when call started 5775
Cached Commit SCN referenced 9264
Commit SCN cached 1
DB time 6999
Effective IO time 4262103
Number of read IOs issued 2155
OS All other sleep time 10397
OS Chars read and written 340383180
OS Involuntary context switches 18766
OS Other system trap CPU time 27
OS Output blocks 12445
OS Process stack size 24576
OS System call CPU time 223
OS System calls 20542
OS User level CPU time 5526
OS User lock wait sleep time 86045
OS Voluntary context switches 15739
OS Wait-cpu (latency) time 273
SQL*Net roundtrips to/from client 14
buffer is not pinned count 2111
buffer is pinned count 334
bytes received via SQL*Net from client 4486
bytes sent via SQL*Net to client 28989
calls to get snapshot scn: kcmgss 510
calls to kcmgas 4
calls to kcmgcs 119
cell physical IO interconnect bytes 340041728
cleanout - number of ktugct calls 1
cleanouts only - consistent read gets 1
cluster key scan block gets 179
cluster key scans 168
commit txn count during cleanout 1
consistent gets 41298
consistent gets - examination 722
consistent gets direct 30509
consistent gets from cache 10789
consistent gets from cache (fastpath) 9038
cursor authentications 2
db block gets 7
db block gets from cache 7
dirty buffers inspected 1
enqueue releases 58
enqueue requests 58
execute count 510
file io wait time 6841235
free buffer inspected 8772
free buffer requested 8499
hot buffers moved to head of LRU 27
immediate (CR) block cleanout applications 1
index fast full scans (full) 1
index fetch by key 196
index scans kdiixs1 331
no work - consistent read gets 40450
non-idle wait count 1524
non-idle wait time 1208
opened cursors cumulative 511
parse count (hard) 39
parse count (total) 44
parse time cpu 78
parse time elapsed 343
physical read IO requests 3293
physical read bytes 329277440
physical read total IO requests 3293
physical read total bytes 329277440
physical read total multi block requests 1951
physical reads 40195
physical reads cache 8498
physical reads cache prefetch 7467
physical reads direct 31697
physical reads direct temporary tablespace 1188
physical write IO requests 126
physical write bytes 10764288
physical write total IO requests 126
physical write total bytes 10764288
physical writes 1314
physical writes direct 1314
physical writes direct temporary tablespace 1314
physical writes non checkpoint 1314
prefetched blocks aged out before use 183
recursive calls 1329
recursive cpu usage 76
rows fetched via callback 7
session cursor cache count 8
session cursor cache hits 491
session logical reads 41305
session pga memory max 851968
session uga memory -660696
session uga memory max 3315160
shared hash latch upgrades - no wait 14
sorts (disk) 1
sorts (memory) 177
sorts (rows) 21371
sql area evicted 10
table fetch by rowid 613
table scan blocks gotten 30859
table scan rows gotten 3738599
table scans (direct read) 4
table scans (long tables) 8
table scans (short tables) 3
user I/O wait time 1208
user calls 16
workarea executions - onepass 7
workarea executions - optimal 113
workarea memory allocated -617 -
Error while executing the compilation process
Hi,
ISA Framework: com.sap.engine.services.servlets_jsp.server.jsp.exceptions.CompilingException: Error while executing the compilation process: javac: invalid flag: "/usr/sap/CJP/J06/j2ee/cluster/server2/apps/sap.com/crm~isauseradm/servlet_jsp/isauseradm/work/jsp_login XXXXXXXXXXX.java" Usage: javac <options> <source files> where possible options include: -g Generate all debugging info -g:none Generate no debugging info -g:{lines,vars,source} Generate only some debugging info -nowarn Generate no warnings -verbose Output messages about what the compiler is doing -deprecation Output source locations where deprecated APIs are used -classpath <path> Specify where to find user class files -sourcepath <path> Specify where to find input source files -bootclasspath <path> Override location of bootstrap class files -extdirs <dirs> Override location of installed extensions -d <directory> Specify where to place generated class files -encoding <encoding> Specify character encoding used by source files -source <release> Provide source compatibility with specified release -target <release> Generate class files for specific VM version -help Print a synopsis of standard options ].
We get this message periodically then we login to isauseradm-application or shopadmin-application.
How we can solve this issue? Why it's appears in system?
/nwa shows this error:
Process after commit failed - may be hanging internal locks mut be removed manually.
Where I can see hanging internal locks ?
Denisto add some information,
in runtime workbench, component monitoring, performance monitoring and all other thing except message monitoring is OK. -
Can use the same thread safe variable in the different processes?
Hello,
Can use the same thread safe variable in the different processes? my application has a log file used to record some event, the log file will be accessed by the different process, is there any synchronous method to access the log file with CVI ?
DavidLimiting concurrent access to shared resources can be better obtained by using locks: once created, the lock can be get by one requester at a time by calling CmtGetLock, the other being blocked in the same call until the lock is free. If you do not want to lock a process you can use CmtTryToGtLock instead.
Don't forget to discard locks when you have finished using them or at program end.
Alternatively you can PostDeferredCall a unique function (executed in the main thread) to write the log passing the apprpriate data to it.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
Execute a DML process after user selects a column link in a report
APEX 3.2 / RDBMS 10GR2
I have written a non IRR report that displays several rows of data. The first column of each row has a defined column link uniquely identifying the row. When a user selects one of the rows via the column link, a "hi fidelity" report is generated for that displayed row using a (RTF) report layout created in the shared components section of APEX.
This is working well but I also need to execute a DML process after the user selects a row but prior to displaying the hi fidelity report using the selected column link value of the displayed row.
As a URL is used to call hi fidelity report via the column link, it does not appear that the process section of the APEX page component is available to execute the DML prior to displaying the report.
Any ideas on where to define the DML process?
Thanks in advance.
Barry DHi Barry,
Not knowing exactly what your URL calls, this is what I do for PL/SQL procedures that create HTML output:
Create a blank page with no template and call the procedure inside a PL/SQL region with no template.
Alternatively, if your URL opens in a new window:
run some javascript for your link and pass a unique request through.
The javascript needs to find the ApEx form, update it's target attribute and submit it with the unique request, then set the target back to blank.
The form will submit into a new window.
You can then have a process and branch allocated to this unique request to do what you want.
Hope this helps
Regards
Michael -
As I said, the other day I had downloaded the latest version of Firefox and after doing so none of the icons for the different websites that normally go to are no longer there. Websites such as MSNBC, MSN, Most visited, that entire strip is no longer visible. I tired resetting Firefox and still nothing. Can anyone tell me how to get them to appear again? It's a hassle every time that I want to go to one of those sites I have to type it in the search bar, instead of just clicking on it as I did before. Please keep in mind if you answer, that I'm still learning about these things called computers and not very well versed in some of the things that you experts know:) Thanks
On Windows XP Firefox shows the menu bar by default and not the orange Firefox menu button that is shown when the menu bar is hidden.<br />
The menu bar is the toolbar at the top that shows menu items like File, Edit, View, History, Bookmarks, Tools, Help.<br />
You can press the F10 key or tap the Alt key to bring up the "Menu Bar" temporarily in case this bar is hidden (View > Toolbars or Firefox > Options).
The Navigation Toolbar shows the Back and forward button and the input field where you type the address of a site that you want to visit (aka location bar) and also has a search bar where you can type items that you want to look up with a search engine (Google).
See also:
*https://support.mozilla.org/kb/how-do-i-get-firefox-button
*https://support.mozilla.org/kb/Menu+bar+is+missing
*https://support.mozilla.org/kb/Browsing+basics
*https://support.mozilla.org/kb/Tabbed+browsing
You can attach a screenshot in case you still have problems with the toolbars to show what you want to change.
*http://en.wikipedia.org/wiki/Screenshot
*https://support.mozilla.org/kb/how-do-i-create-screenshot-my-problem
Use a compressed image type like PNG or JPG to save the screenshot. -
How can I register the iTunes without a credit card? No "None" can be selected but only different kinds of credit cards. Thanks!
Get an iTunes gift card & redeem that in iTunes using your existing Apple ID.
Then the option for none, regarding a credit card should appear. -
Error while executing master data process chian
hi,
I'm trying to execute Master Data Process Chain in BI 7.0. But i'm getting errors at the DTP process of two info objects. The error message is like "equest 357 is already being processed and Exception CX_RSBK_REQUEST_LOCKED logged."
Can anyone tell the reason and how to resolve this issue?
Thanks
HimaHi Hima
Check if there is any other loads, fetching the same Request OR you can goto SM37 and goto Job log and check the status of the JOB... if it is finished, then check the status of the request too.You can repeat the locked request, if the previous req is either successfully completed or failed...wait until the dependent request is finished
just check this and repeat the req.. it should get successful now...
Regards
Rohit -
Hi Experts,
I am getting a dump when executing /SCMTMS/TEND_CONT_PROCESS (Process Frieght quotations and overde Freight RFQs).
Runtime Errors UNCAUGHT_EXCEPTION
Except. /BOBF/CX_FRW_FATAL
ABAP Program /BOBF/CL_FRW==================CP
Application Component AP-RC-BOF-RNT
HOW TO CORRECT THE ERRORS-
"UNCAUGHT_EXCEPTION" "/BOBF/CX_FRW_FATAL"
"/BOBF/CL_FRW==================CP" or "/BOBF/CL_FRW==================CM00Z"
"SET_APPLICATION_ERROR"
i really dont know why this dump is coming. I checked the "SET_APPLICATION_ERROR" method.
==> RAISE EXCEPTION TYPE /bobf/cx_frw_fatal
EXPORTING
textid = /bobf/cx_frw_fatal=>sc_application_error
previous = io_exception
mv_bo_name = mo_conf->ms_obj-bo_name
mv_proxy_bo_name = mo_conf->ms_obj-bo_esr_name
application_information = lv_application_information.
Can anyone tell me the possible reason for this dump?
Thanks.
Regards,
Meenakshi -
Is there a tool available that can be executed by another process to scale the actual size of the printed PDF file by X%? We are attaching PDF files to printed output using the Oracle DocuMaker product, and are running into margin issues with the attached PDF. We need to keep a 3/4 inch margin on our pages for sorting/finishing equipment, and the attached PDFs do not all conform to our margin requirements.
What email program are you using? And what do you mean by "Safari mail"?
-
Wait for a file and start execute a scenario process
What is the best way to achive: Wait for a file and then once the file in droped...execute a scenario process.
Sample scenario:
- Admin user ftp the file to a target directory on Unix (export/home/odi/input/files)
- A scheduled scenario package will be running/scheduled daily
- In the above scenario, The first step is to have one OdiFileWait (with options: Dir:/export/home/odi/input/files, File: xxxxx.txt,wait time and loop over..etc)
/* But for some reason OdiFileWait is not waiting/checking for the file presence define in the option. It seems to run immediately without checking the presence of the file and passing it to run the second step) */
- The second step is the "OdiStartScen" (This will run an interface generated scenario) and since the file doesn't exist as a source to load that this interface uses...its fails.
What's the common practice to accomplish this? Appreciate your feedbacks…
Thank youUpdate:
I increased the timeout and Pollint setting in OdiFileWait option and its working fine now.
When the file exists (or) ftp within the timeout the process goes to next step (OK). But, say the file doesn't exists and the timeout finished...how do i set a KO to OdiFileWait and stop/complete by existing at that step itself with out failure. -
Hi,
We recently encountered a scenario in our Cloud Services Web Role web app where simultaneous api calls on the same item occurred, such that IIS automatically allocated them to be handled on separate threads inside the same w3wp process. We needed to handle
this scenario by rejecting/ignoring whichever call came in second, so we just used a static ConcurrentDictionary object to track which items were currently "locked".
But I'm concerned that as we scale up eventually Azure will start routing such calls to different w3wp processes or even different machines. In such a case, a static in-memory object is obviously not going to do the job. For now all I want to
do is find out what happens in the scenario where two requests are handled by different processes/machines - so what's the easiest way to trigger an Azure web role into this behaviour?
Thanks
DylanI've confirmed via MS support that my assumptions were basically correct - if you have Instances = 1 then all requests for a single web application will be handled by one instance of the relevant w3wp process.
If Instances > 1 then they might be handled by w3wp processes on separate virtual machines. There's no known scenario where there would be multiple w3wp processes on one machine, so if you need to handle concurrency for a scalable web-app, you have to
use some central resource that is available to all instances. -
Creating pocess intance of a different process and passing arguments
Creating Process instance of a different process:
I have two different process: Main_Flow (id: MainFlow) and Second_Flow (id: SecondFlow). In the first process I am reading a csv file. Each line of the file has four columns. After reading each line I have to initiate Second_Flow and pass the read data from the file. (Pls find the code below for the whole process):
fileReader = FileReader(arg1 : fullFileName);//filename is of file type and have file name and path
Java.Io.BufferedReader reader = BufferedReader(arg1 : fileReader);
String str;
int countLines = 0;
while ((str = reader.readLine()) != null)
strColumn = str.split(delim : ",");
int ColumnCnt = 0;
while (ColumnCnt < 4)
//defining variables
String appNo;
String custNo;
String loanAmm;
String loanDate;
//logMessage("Value at Column: " + ColumnCnt + " is " + strColumn[ColumnCnt]);
if (ColumnCnt == 0)
arrLoanData["appNo"] = strColumn[ColumnCnt];
else if (ColumnCnt == 1)
arrLoanData["custNo"] = strColumn[ColumnCnt];
else if (ColumnCnt == 2)
arrLoanData["loanAmm"] = strColumn[ColumnCnt];
else if (ColumnCnt == 3)
arrLoanData["loanDate"] = strColumn[ColumnCnt];
arrLoanData["descriptionArg"] = "AutoInstance: " + formatTime('now', timeStyle : Time.SHORT);
arrLoanData["genByArg"] = "Automatic";
ProcessInstance.create(processId : "/SecondFlow", arguments : arrLoanData, argumentsSetName : "BeginIn");
ColumnCnt = ColumnCnt + 1;
countLines = countLines + 1;
(“The code is in Java and not in PBL”)
I have to pass appNo, custNo, loanAmm and loanDate as the arguments. The Argument will be of Any[String] type. The argument set name of Second_Flow is “BeginIn”. But I am not getting anything in Second_Flow.
What can I do in the argument mapping of begin of Second_Flow to get the passed argument (array)?the argument 'arguments' for the method ProcessInstance.create receives a map of the arguments that the 'argumentSetName' argument set will receive.
so for example if your second flow has 2 arguments, String name, Decimal value and String[] content your method invocation would be:
ProcessInstance.create(processId : "/SecondFlow", arguments : {"name": strNameFromCsv, "value": valueFromCsv, "content": ["a","b","c","d"]}, argumentsSetName : "BeginIn"); -
Is there a different process to upload video podcast or is it the same?
Is there a different process to upload video podcast or is it the same process?
Exactly the same. The only difference lies in the code within the 'enclosure' tag which needs to match the file type, and most podcast creation programs and service will handle that for you. However you need to be aware that you are limited to .m4v, .mov or .mp4 files (not Windows Media, RealMedia or Flash).
You may find my 'get you started' page on podcasting helpful:
http://rfwilmut.net/pc
Maybe you are looking for
-
Display input variables in BEx workbook header
Hi forum, I created a global BEx workbook template and would like to display the input variables (user entries) in the header section. On refresh of the workbook, this section should be updated with the new input variables. I am on BEx 7.0 and alread
-
Upgrading RAM for MacBook Pro (Retina, Mid 2012)
I want to upgrade RAM , currently 8 GB, to 16 GB . Is it possible to upgrade ?
-
Hi group At our site I find that they have set up both subtype 0012 and 0030 for private email-address. They are both translated to "Private email" in our language. 0012 is used the most and is described in our user documentation. But I see that subt
-
Finder copy doesn't copy all files
I have a dedicated disk for my Aperture masters, and to back this up while also defragging (according to a method described by Kevin J Doyle and Matthew Bergsma on the Aperture forum) I'm simply doing a Finder copy of the masters. I may have made a m
-
NodeManager does not pass PATH variable to ./bin/startWebLogic.sh script
I've been agonizing with the "<em>uname: not found</em>" errors reported by a few others that are attempting to start managed servers from WLST or their Admin consoles. By turning on execution tracing [set -x] I've been able to establish that the <st