ProcessTCPEvents & priority inheritance

Hello,
I'm working with CVI RT on a dual core PXI. One CPU is dealing with TCP (server) and the other one is running a 1kHz custom regulator.
When a windows client connect on the PXI, the server receive the configuration and the start command. During regulation, mean values are sent every 100ms. Everything is fine and both CPU are loaded between 2 and 3 %.
After 5 to 15 s both CPU are 100% loaded during 1 to 2 s before going back to the previous state.
By using the real time execution trace toolkit I identified the problem around the function ProcessSystemEvents running on CPU 0. The client does NOT send any request and there is nothing to process comming from TCP (except server mean values emission every 100ms). The server thread (THREAD_PRIORITY_NORMAL, CPU 0) inherits the priority of the regulator thread (THREAD_PRIORITY_HIGHEST, CPU 1). Because there is no activity on TCP from client to server I assume that the only function running on the server Thread is ProcessSystemEvents.
So why ProcessSystemEvents never end up ?
I set name to identify Threads and RTETT display them correctly, I did the same for lock but I cannot see anything. Is there a way to display them ?
Best regards
JFM
Attachments:
TCPUserEvents.zip ‏642 KB

Additionnal informations:
I tested a new version of the Real-Time controller program without any CVI TCP function. Everything is low level socket based. I also removed all critical sections but the problem is still there.
The switch occurs now between my regulator thread on CPU 1 and the server loop on CPU 0 (still no activity on TCP...). printf is executed very often during the switching period but I'm not using printf in my software !
I'm not sure to be able to relies on the trace toolkit because:
* the program is running during ~20s but I sometimes get 20ms in the trace toolkit (sometime 5s but never the expected duration)
* I set name for thread and lock (I kept the creation/destruction and just remove acquire and release) and a lock name show up in the thread view...
Any ideas ?
Is there new versions of software I can use to debug that problem ? (CVI 9.1.1 > 450 & RTETT 2.0.3).
JFM

Similar Messages

  • Should I be able to see a priority change using a mutex priority ceiling

    If I have a program which uses a mutex lock in solaris 9 which is set up to protect/priority ceiling of 5 and kick it off using priocntl with a priority of 11 and RT, I can look at top and see that it has priority 111. So my process is running real time. I then use a second xterm and wait till the program hits the lock portion of the code. If I do a priocntl -d pid, it is still priority 11. I know it is in the lock because there is a printf and a sleep of 20 seconds. Should I be able to see the priority go to 5? How can I prove the priority inheritance off the mutex lock is working in a test program? Thanks for any insight.

    I also tried it with a priority ceiling of 50, figured out that RT priorities worked the reverse of regular priority, the higher the priority number, the higher the priority. I still however am not able to prove the priority inheritance occured. Anybody got any thoughts on how to prove it is working properly.

  • Should I be able to see a priority change using a mutex lock   ?

    If I have a program which uses a mutex lock in solaris 9 which is set up to protect/priority ceiling of 5 and kick it off using priocntl with a priority of 11 and RT, I can look at top and see that it has priority 111. So my process is running real time. I then use a second xterm and wait till the program hits the lock portion of the code. If I do a priocntl -d pid, it is still priority 11. I know it is in the lock because there is a printf and a sleep of 20 seconds. Should I be able to see the priority go to 5? How can I prove the priority inheritance off the mutex lock is working in a test program, so that I know I am using it correctly? Thanks for any insight.

    I also tried it with a priority ceiling of 50, figured out that RT priorities worked the reverse of regular priority, the higher the priority number, the higher the priority. I still however am not able to prove the priority inheritance occured. Anybody got any thoughts on how to prove it is working properly.

  • RTSJ thread priorities, Lower priority thread running

    Hi,
    I'm experimenting with a thread pool that I've written containing javax.realtime.RealtimeThreads. I'm trying to use this to replace a java.util.concurrent.Exectutor type thread pool in an existing application. My design involves a Queue where the RealtimeThreads wait on until a Task is submitted for execution. All the threads in the pool start at the lowest priority and upon the submission of a task, I have written some logic to increase the priorities of the threads that I want run.
    At a given time, there could be many threads with tasks assigned to them and some without tasks. My algorithm to decide which thread is to be given the CPU, runs every time a task is submitted to the system as well as at the end of the current thread execution. I assumed that If I set a thread's priority higher than the others it would automatically be given the CPU and all I have to do is to set the Priority using rtThreadObject.setPriority() method. I obtain the highest priority in the system through PriorityScheduler.instance().getMaxPriority() method and do similarity to obtain the Normal and Lowest priorities in the system.
    Recently I added some code to change the priority of a thread from another, and noticed that the target thread's priority is higher than the one that is currently running. I'm not sure how a lower priority thread can run, when a higher priority thread is already in the system. I'm wondering whether it's to do with the current thread of execution getting woken up by a task submission (I do a QueueObject.notify() ) and continue to run at the lower priority, I have my doubts on it. Can anyone give some ideas as to how such an instance could exist?
    I'm developing on a Linux-RT kernel with RTSJ 2.1
    Thanks,
    Vidura

    Sorry for the delayed response.
    Thanks a lot for the answer. This certainly might be the case in my scenario as well. However, is there a way that I could query the active priority from a Thread and confirm? I also have a few questions just to confirm my thoughts on such a scenario.There is no way to query the active priority of a thread.
    1) Can Priority inheritance take place if a high priority thread is blocked on some IO operation say even a simple System.out.println ?Priority inheritance occurs when a thread holding a monitor causes a higher-priority thread to block trying to acquire that monitor. At that point the thread holding the monitor is given the priority of the thread it is blocking. So this can happen anytime a lock is held, regardless of what the thread is doing at the time.
    2) In the simple scenario of a couple of threads with different being active at the same time with Java or RTSJ in particular, as long as the threads are not blocked or competing for a shared resource, is it possible to assume that the highest priority thread will get the CPU 100% of the time?The simple answer is "yes" but reality is more complex. Shared resources occur at the application, VM/runtime-library, and OS levels. You would have to avoid them at all levels to ensure the highest base priority thread is also the highest active priority.
    3) If we as programmers takes great care in preventing IO operations (or controlling any IO operations, i.e. where to place them in the code) even simple as a System.out, priority inversions or inheritance would not take place?Priority inheritance is not directly related to I/O operations - the issue is whether methods are synchronized or not.
    4) In such a scenario highlighted in 3, what practices could be used to debug the code if needed?On Solaris we use DTrace and the Thread Scheduling Visualizer for debugging timing/scheduling relationships. I'm afraid we don't have anything equivalent on Linux at this this time.
    As for exactly what I'm trying to do, it's a bit convoluted as I'm trying to achieve predictability in an existing product using RTSJ, that wouldn't be used in the trivial real-time sense, like an embedded environment, rather as a normal application. I will follow up with more details of it if needed.Don't worry, we have numerous users applying real-time Java to "normal" applications. :)
    David Holmes

  • High-level interrupt handler

    Why can I decide to support a high-level interrupt or not? Under what condition does the Solaris kernel will map my hw interrupt (INTA from PCI bus) to a high-level interrupt? When should I refuse to support a high-level interrupt? Why? Can I force my hw interrupt to be a high- level interrupt?
    Also think about that, most hw interrupts indicate something important such as the case buffers are full. If they are assigned below the scheduler's, it really does not make sense.
    Is it possible to block any hw interrupts? Or I'd put it this way can I prioritize hw interrupts in Solaris?
    Thanks
    tyh

    Hi,
    On x86 each IRQ has a software priority assigned to it implicitly by the bus driver, although I think you could override it in the driver.conf. Unlike SPARC, the processor doesn't support a PIL so software priorities are implemented by masking all lower-priority IRQs and re-enabling interrupts.
    High priority interrupts, above dispatcher level, run in the context of the current thread on the cpu, normal level interrupts are handled by interrupt threads.
    The interrupt threads are the highest priority threads on the system, so will preempt any other running threads. In addition mutexes in Solaris use priority inheritance, so the interrupt threads will get to run.
    In general, high level interrupts are allocated to devices with small buffers such as serial or floppy, so that their buffers get serviced in the fastest possible time. Others can afford to wait for just a bit.
    Your driver should check to see if its device has been allocated a high level interrupt. If this is the case, the high level handler should clear the interrupt and save the data/status (in the driver state structure perhaps) and trigger your soft level interrupt handler (which will run as a thread).
    Blocking of interrupts is done for you when you acquire a spin mutex (ie initialised with an iblock cookie). Such a mutex is required to synchronise access to data shared with a high level handler in your driver.
    Please take a look at the Intel Driver writers orientation at:
    http://soldc.sun.com/developer/support/driver/docs/Solaris_driver_models/index.html
    Hope that helps,
    Ralph
    SUN DTS

  • Is there a way to disable interrupts for a Solaris 9/ sun OS 5.9 machine

    I am trying to figure out if there is a way to disable interrupts in solaris 9 on a sun 5.9 sparc9 machine, while under lock. I don't want the process to get bumped under lock. I have been looking for a way to do it and have come up empty handed. Am I just missing something? -Thanks

    Thanks for the response, I understand that using real time scheduling I can still be preempted. I also understand how to solve my problem on a multiple CPU machine. Unfortunately I only have that luxery on part of the system. There is a part of the system, 7% of the processes, that run on a single cpu machine. This is a customer requirement, I can't change it. What I want to do is possibly take advantage of the priority inheritance features of the mutex locks, however, I believe this needs to be enacted as root, since they need to run real time and it seems that you need to be root to enable the real time features. However, to propose this as an option to solve my issue, I need to show that it works. I have kicked off a process using priocntl with RT and a priority of 11, and I can see them run as real time and in a priority level of 111 using TOP, but when I put code in so I know they are in the mutex portion of the code, I don't see a priority change. I created a mutex with the protect option and a priority ceiling of 5. Does anyone know if this would be reflected anywhere. I tried opening an xterm and using a priocntl -d, but I see priority 11 even when it is in a mutex with a ceiling of 5. I would have expected it to go to five. Just in case I had the levels backwards, I also tried a ceiling of twenty and there still was no change. How can I test the priority inheritance capability? Does anyone know which call would reflect the priority change? I just need to show it does something in order to propose the change at that low of a level in our system code. Thanks again everyone who has tried to help me understand this.

  • Libc 2.5 is out!

    Too much news recently. :-)
    Source:
    http://sources.redhat.com/cgi-bin/cvswe … root=glibc
    http://sources.redhat.com/cgi-bin/cvswe … root=glibc
    Not many changes, but some of them might cause incompatabilities.
    * For Linux, the sorting of addresses returned by getaddrinfo now also
      handles rules 3, 4, and 7 from RFC 3484.  I.e., all rules are handled.
      Implemented by Ulrich Drepper.
    * Allow system admin to configure getaddrinfo with the /etc/gai.conf file.
      Implemented by Ulrich Drepper.
    * New Linux interfaces: splice, tee, sync_file_range, vmsplice.
    * New iconv module for MIK.  Contributed by Alexander Shopov.
    * For sites with broken group and/or passwd database, the auto-propagate
      option of nscd can prevent creating ID lookup entries from the results
      of a name lookup and vice versa.   This usually is no problem but some
      site might have problems with the default behavior.
      Implemented by Ulrich Drepper.
    * Iterating over entire database in NIS can be slow.  With the
      SETENT_BATCH_READ option in /etc/default/nss a system admin can decide
      to trade time for memory.  The entire database will be read at once.
      Implemented by Ulrich Drepper.
    * The interfaces introduced in RFC 3542 have been implemented by
      Ulrich Drepper.
    * Support for the new ELF hash table format was added by Ulrich Drepper.
    * Support for priority inheritance mutexes added by Jakub Jelinek and
      Ulrich Drepper.
    * Support for priority protected mutexes added by Jakub Jelinek.
    * New locales: nr_ZA, pa_PK, ca_AD, ca_FR, ca_IT, el_CY, tr_CY, as_IN,
      or_IN, csb_PL, fy_NL, sr_ME.

    IIRC using hash table in ELF allows for faster application start because of faster linking. Am I right?

  • OR between groups in Row-Restrictions, priority - Universe Design

    Old School Univers Design, no SAP source, but plain Oracle
    Two Questions here
    1 - Priority in rowrestrictions
    from documentation:
    u201CYou can specify which restriction to apply to a user that belongs to multiple groups using a universe. For example a user belongs to two groups, Sales with a restriction to view 5000 rows of data, and Marketing to view 10000 rows. When the user refreshes a report, the restriction associated with the lowest level group is applied. In the example above, if the Sales group had order 1 and Marketing had order 2, the restriction from marketing (10000) would be used.u201D
    I read in the documentation for Rowrestrictions, that the restriction on top of the order list will be the one kicking in, in case of a huser having two conflicting restrictions.
    Does anyone have experience with this ?
    Does it work ?
    My experience is that its not working.  Both rowrestrictions gets into the SQL with AND between as shown
      AND  ( FLEX_SEGMENT5.FLEX_VALUE IN (030,033,090,805,041,062,048)
      AND  FLEX_SEGMENT5.FLEX_VALUE IN (041,048,062)
    the first line is my new restriction with priority 1,
    the second line is the other restriction with priority 6
    2 - OR between groups
    there is a Restriction option in Manage Rowrestrictions , where you can spesify Rowrestriction Combinations using AND or OR.
    I have not been able to have this working.
    Anyone having a positive experience here ? Or have I misunderstood what this actually means.
    I would expect 
      WHERE  ( FLEX_SEGMENT5.FLEX_VALUE IN (030,033,090,805,041,062,048)
      OR FLEX_SEGMENT5.FLEX_VALUE IN (041,048,062)
    What I get is
    ( FLEX_SEGMENT5.FLEX_VALUE IN (030,033,090,805,041,062,048)
      AND  FLEX_SEGMENT5.FLEX_VALUE IN (041,048,062)
    Is this a known bug ?
    I have tried this in WEBI 3.1 and R2

    Hello,
    In fact, Priority is used for universe overload where only one overload among several might apply. This is the case for connection overloads, table mappings..., but not for row restrictions.
    For row restrictions, you have AND/OR aggregation operators. In Universe design tool, you have the option to choose how Row restriction will aggregate (click the "cog" icon):
    + Combine row restrictions using AND
    + Combine row restrictions using AND within group hierarchies and OR between groups
    In the first case, all row restrictions that might apply to a user will be aggregated with AND operators.
    In the second case, row restrictions that are inherited are aggregated with AND operators and the ones coming the user groups a user belongs to are aggregated with OR operators.
    Ex with the following user groups organisation:
    G1
      G11 (G11 belongs to G1 group)
    G2
      G21 (G21 belongs to G2 group)
    and user U belongs to G11 and G21 user groups.
    Final row restriction that applies to the user U is:
    (G1 AND G11) OR (G2 AND G21)
    Hope it helps.
    Cheers
    ~~cas

  • Priority Queue problem

    Hi Everybody.
    Can anyone tell me in which order elements of priority queue are sorted.
    I have used following code
    class Test{
    PriorityQueue <strings> pq=new PriorityQueue <Strings>();
    pq.add("silpa");
    pq.add("swati");
    pq.add("roopa");
    pq.add("abc");
    System.out.println(pq);
    System.out.println(pq.poll());
    System.out.println(pq.peak());
    The output I got is
    [abc silpa swathi roopa]
    abc
    roopa.
    Can anybody explain why the collection elements are not sorted ?
    I am getting correct output with peek() n poll().According that methods i should get
    [abc roopa silpa swathi ]
    Explain the reason?

    System.out.println(pq);This line prints out the contents of the queue, by implicitly calling pq.toString(), whose behaviour is inherited from AbstractCollection, which therefore has nothing to do with sorting. So you have no valid reason for expecting any particular ordering.

  • Access control: what is the priority of access control entities (ACE)?

    Dear Bee-lievers,
    as I had some troubles implementing some special access control, I just read through the admin guide, chapter 13 (Managing Oracle Beehive Access Control).
    Even after that, I'm not clear about priority of ACEs in ACLs: if, for a given accessor, one ACE denies access, while another grants access ... which will win? I'd guess (and it looks like) the deny will win.
    Furthermore: What about inheritance of ACEs, e.g. in team workspaces?
    An explicit ACE on a special folder does seem to imply implicit access for workspace members.
    What I'm trying to implement is the following: within a team workspace, where access is granted on group basis, I want to set up a restricted folder for another group (all members of the restricted group are also members of the team group).
    Regards, Thomas

    Bee-lievers,
    for the time being we found the following workaround, with the help of
    support:
    The privileged members of group group2 are tagged in their user
    attributes with a unique string, say "beehive-grp-wrkrnd-group2" (we
    take the unused, but always non-null field LDAP field gecos, mapped to
    UDS attribute nickname, to minimize GAL visibility of this
    workaround).
    These members are then sorted out in a dynamic group, say
    ZZ_group2_complement with the following query: nickname does not
    contain "beehive-grp-wrkrnd-group2".
    Thus, the following access does what we desire:
    -----------------------------------------+--------------------------------------
    accessor | access_types
    -----------------------------------------+--------------------------------------
    agrp=ALL_USERS |
    -----------------------------------------+--------------------------------------
    grup=ZZ_group2_complement,enpr=enpr | -RWDEO
    -----------------------------------------+--------------------------------------
    We hope that ER 9414428 will be addressed soon. It could be all very
    simple if there was no implicit inheritance of the perms defined at
    workspace level!
    Regards, Tom Beekeeper

  • WD framework generated logging priority is set to PATH, any reason?

    Hi All,
    as I am using the logging to help to solve customer problems, I noticed if I enable the locations, there will be framework-generated messages in the log files as follows:
    [SAPEngine_Application_Thread[impl:3]_35] Path: exiting: wdDoExit
    Feb 28, 2007 12:11:16 PM        com.sap.mdm.ui.search.wdp.InternalBasicView [SAPEngine_Application_Thread[impl:3]_35] Path: entering: wdDoExit
    Feb 28, 2007 12:11:16 PM        com.sap.mdm.ui.search.wdp.InternalBasicView
    As one can see, all these messages are written by internal (generated) code. The problem is that as I enable the location "com.sap.mdm.ui.search", "com.sap.mdm.ui.search.wdp" is also enabled (inherited), which leads to a messy log files. Since I use DEBUG to write my debug messages, I cannot turn off the internal messages by setting the Priority of the location "com.sap.mdm.ui.search" to "DEBUG" because in SAP logging framework, PATH has a higher priority than DEBUG. I think this kind of internal messages should have a priority as TRACE, which is lower than DEBUG.
    Could anyone clarify why it's necessary to have such messages as PATH?
    Best regards,
    Ge

    Close this since no reply.

  • For which one is the priority? constructor or method ?

    Hi
    if i have A constructor and a method and both of them working on the same variable, so for which one is the priority ?
    Message was edited by:
    scrolldown

    whichever one gets there first. no, really. and a
    constructor is just a methodAu contraire, mon fr?re!
    Constructors are not methods, because unlike methods,
    they are not
    even technically members of a class.
    http://java.sun.com/docs/books/jls/third_edition/html/
    classes.html#8.8
    <quote>
    Constructor declarations are not members. They are
    never inherited and therefore are not subject to
    hiding or overriding.
    </quote>I stand corrected there, then. aren't they described by the same bytecode instructions, though? I know that when using, say, BCEL, constructors and initializers are generated as methods. whatever, I'm obviously barking up the wrong tree there

  • New DVR Scheduler Bugs: Priority Settings No Longer Working, Scrolling Series Schedules is Flakey

    Hi,
    After this last HD DVR update, I have two new problems:
    1) I can no longer set the priority of most of my series schedules. I have about 100 series schedule entries, which the DVR update probably wasn't tested for.
    Now when I try to set a series priority, it LOOKS like it worked, but if I get out of DVR options and go back into Manage Recordings, 90% of the time I find that the series priority is either unchanged, or (even worse) has bounced up to some unexpected random priority - Thus, I have to search the series list  to find it - Then I cannot move it back to where it's supposed to be!
    It seems that only moving a series priority a little bit will sometimes work, but moving the series from near the top of the list to near the bottom (or vice-versa) doesn't work at all, even though it may appear like it worked until the list is refreshed (either by paging up and down the list a few times, or by exiting the DVR manager and going back in).
    2) The scrolling is messed up now in the series schedule manager - When setting Priority, as I scrool up or down from the middle of the list using the arrow or Page buttons,  the list will end unexpectedly, making it impossible to actually drag the series to the bottom or top of the list. Then if you deposit the series at the "end" of the list, suddenly the rest of the list will then magically appear (of course, the series schedule you deposited there will no longer be where you deposited it - See problem #1). Obviously the list is running out of buffer space, so the next part of the list isn't being loaded while you're in the process of changing a series priority..
    Scrolling is also messed up just scrolling through the list without changing priority: Scrolling through my series schedules USED to be very FAST and painless using the Page (Channel) up/down button, I could scroll from top to bottom of my 100 series schedules in a matter of like 5 seconds. NOW, it takes forever and is a real pain to scroll from top to bottom, because the scrolling pauses on just about every other page - As though it ran out of buffer space and is having trouble loading the next buffer.
    I have a lot of series schedule entries so all the First-run Programs are at the top of the priority list, then all the re-runs are in the bottom half of the list. That's the only way I have found to prevent Re-Runs from hijacking new programs, since there's no DVR option to prevent re-runs from inteferring with new episodes (BTW, in order for this to work, the First-Run schedule must be created first. Then a duplicate First-Run and Reruns schedule must be created - Creating them in reverse order will throw a "Duplicate" error message).
    The DVR software has always been buggy and feature-depribed, but this is rediculous - To think the programming team didn't even test the scrolling and priority of series schedules is as bad as the ObamaCare website, and that's setting a very low bar! You HAVE to test EVERYTHING when you release new updates, even if the programmers say it won't affect anything else, because from my experience programmers develop tunnel vision (been there, done that myself), and if you have more than one person on the programming team, neither programmer will communicate their changes to anyone else (been there, done that too).

    I have the identical problem after the recent software upgrade which VERIZON did to my DVR.
    In addition, I have "Manual Series" listed under the "Manage Series Recordings" section of my DVR for about 10 of the tv shows that I have tagged to be recorded weekly. Several others have reported this seemingly related problem to this forum.
    I've tried twice to report the latter problem to VERIZON's technical support staff, but met with indifference in the first attempt (a guy recommended that I replace my DVR with a new one - an utterly ridiculous suggestion), and in my second attempt I got a somewhat helpful lady who couldn't correct this glitch and was unaware of others having same problem but promised to send it up the flagpole to higher level tech folks (best action that I realistically could get).
    As I told VERIZON's techies, I likely was not the only customer experiencing these problems - and your and others postings to this forum confirm my initial hunch.  VERIZON leaves a lot to be desired in the testing of their software "upgrades".

  • Spawn jobs are not getting priority and target servergiven at selection scn

    Hi Abapers,
    I am scheduling main program as a job in backend through FMs JOB_OPEN, JOB_SUBMIT and JOB_CLOSE with priority and target server taken from user at selection screen through SE38,after executing the job,job will generate the spawn jobs (i.e child jobs). The spawn jobs  also be scheduled with same priority and target server from taken user. But after completion of main job execution, the spawn jobs are not generating with same priority and target server taken from selection screen. May be its getting refreshed.
    Please give me an idea how the spawn jobs also have to get the same priority and server of main job?
    Please reply as soon as possible. I need it urgently.

    Hi,
    I have used below statements for ADD EXTRACT and ADD REPLICAT.
    ------Extract
    ADD EXTRACT ext_1, TRANLOG, BEGIN NOW
    -------Data Pump
    ADD EXTRACT pump_1, EXTTRAILSOURCE /app/ggs/trail/local_trail_1/ta, BEGIN NOW
    -------Replicat
    ADD REPLICAT rep_1, EXTTRAIL /app/ggs/trail/remote_trail_1/tb, BEGIN NOW, CHECKPOINTTABLE ogg.tarun_chk
    Yes, i have tried tutorial at Oracle Learning Library.
    Thanks
    Tarun
    Edited by: user8886876 on Feb 12, 2012 9:56 PM

  • Create at runtime a job to run at the central instance with high priority

    Hi All
    Using the function modules  (  job_open, job_submit and job_close )  or ( job_open, submit via job  jobname number jobcount, job_close) I need that this job runs in the central instance and with high priority.
    I would like to know how to  inform  it using the statements above?  How to pass the parameters to make the job run in the central instance with high priority?
    I would appreciate any help.
    Thanks in advance.
    João Gaia

    Hi
    I hadn't realized about the parameter TARGETSERVER of  the function module JOBCLOSE. I am going to make some tests.
    thanks in advance

Maybe you are looking for