[Condition] Is it possible to make an await() WITHOUT releasing lock?

Like title says...I expose my problem:
I need to impose a FIFO ordering between 2 kind of threads, A and B. A and B come together in the critical section, here A has to check that NO thread of type B is in the section and, if it is not, pass and go in another section and, at the end, modify a variable value in order for B to enter. However, more threads of type A can be together in the 2nd section.
So, if for example we have:
BAAA> | critical | 2nd section |
3 A can enter in 2nd section but 1 B stays outside the critical section.
critical section is like this with condition variables:
lock.lock();
               while(nThreadBInside > 0)
                    waitCond.await();problem is that await() awakens another thread in the queue, so suppose a situation like this:
BABA->
A enters.
B blocks on await unlocking the lock
A enters...no FIFO ordering!
Ho can I solve this?:(

Use a simple in memory flag-- b.inWait(), be awakens checks to see if the flag is still set and if it is goes back to a wait state--works for single events.
In the event you have multiple blockers, you need to keep count of the numer of blockers that have a hold on the wait state, so. Each time an A enters the critical, increment a counter. When b comes out of wait, then have it check the counter--Counter>0, then b goes back to wait. When each A leaves the critical segment, then decrrement the counter.

Similar Messages

  • ERM5.3 - Is it possible to make Sub Process & Project/Release non-mandatory

    Hi All.
    I would like to know whether it is possible to make Sub Process & Project/Release in Create Role Definition section non-mandatory fields?
    If so where would I be able to change the config?
    Thank you.
    Mike Hannie

    Dear Mike Hannie,
    It is not possible. Project/Release ID and Subprocess are required fields.
    The Project or Release ID field allows you to track and filter roles by project or release based on your organizationu2018s requirements.
    When you create a role in Enterprise Role Management, the business process you assign to the role is one of the roleu2018s defining attributes and determines which subprocesses you can assign to that role. During the role creation process, the subprocesses available for you to select as role attributes are determined by the business process to which the subprocess is mapped.
    Condition group:
    A condition group is defined from a set of role attributes (such as a business process, subprocess, functional area, role type, or role name) and is based on role values and conditions. After you create a condition group, the system applies it to a role creation process to override the default role creation process when the criteria from the condition group are met. You can apply multiple condition groups in one role creation process, but you cannot associate multiple processes to one condition group.
    Regards,
    Naveen

  • PR-is it possible to make a pr without entring valuation field?

    Hi all expert,
    i have required one scenarion in purchase rquisition. in our company they want that they make a purhase requisition for issuing a Truck Or ant fleets. and the authorised person could release it.
    but the problem is in purchase requisition w dont want valuation .
    is it possible to make a pr without entring valuation field.
    regards,
    santosh

    First go to SPRO-MM-Purchasing-Purchase Requistion-Define Document types and Identify the Field Selection Screen for Document types.
    Now Using the Same Path go to Define Screen layout at Document level and Change the Field Price & Price Unit as Optional and Save and Try again.
    Regards,
    Ashok

  • Is it possible to make international calls without...

    Is it possible to make international calls without an unlimited plan? If so, what are the skype credit rates for US to UK calls? And do I need to do anything special to set up this ability?

    Hi,
    http://www.skype.com/intl/en/prices/payg-rates/?currency=USD#cc=GB
    http://www.skype.com/intl/en/prices/payg-rates/connection-fees/?currency=USD#cc=GB
    Hth
    On ne regarde pas l'avenir dans un rétroviseur !
    IMac Intel Core i3 3.2 GHz - RAM 12 GB - OS 10.10.3
    Skype 7.8.391
    Logitech usb headset or Jabra 250 bt

  • Is it possible to buy an iphone without being locked to AT&T?

    I'm currently living in Brazil and would like to buy an iphone from the states because it's a lot cheaper and use it with a local carrier, but I don't know if I can buy a iphone 4 that's not locked to AT&T. Anybody have any ideas?

    If you have a non-US address, most likely. Please search also, as this has been asked.
    Click my link, and scroll down to "iPhone 4 At A Glance".
    http://store.apple.com/ca/browse/home/shop_iphone/family/iphone?mco=OTY2ODA2OQ

  • Is it possible to make an iCloud account used by everyone in my school?

    In my school we have iPads. Would it be possible to make an iCloud account used by everyone for contacts and calendars?

    You do not give everyone the username and password of that account.  This would be a violation of iCloud terms and conditions.
    I've done what you want done with a calendar.  You use the iCloud account yourself, then use the 'broadcast' facility to produce a subscription URL that everyone can put into their calendar software.  If you make the calendar public anyone can subscribe.  They don't even have to know the account name let alone the password.
    Log into the account on www.icloud.com and test it out.
    Once you have that working you might try the same thing with a contact list.  I see no reason it shouldn't work.

  • Possible to make an item editable for certain users and read only for other

    Is it possible to make an item editable for certain users and read only for others?
    I've been able to accomplish this by taken the select statement that I used to define an authorization scheme, placing it in the Read Only condition of the item. However, I would like to simply reference the authorization scheme to utilize caching, and to help keep things cleaner for future maintenance.
    Is it possible to reference an authorization scheme in an item condition similar to the way another item can be referenced by preceding it with a colon (i.e. :P1_First_Name)?

    Thank you, your suggestion worked.
    It would be nice on a future release of APEX if a drop-down box existed under the Ready Only section that would allow an existing Authorization Scheme to be selected or negated when applying the Read Only attribute to a form item.

  • Is it possible to make a cell change colour of a period of time with rules?

    Is it possible to make a cell change colour of a period of time? for example
    Date
    Company
    Pick Up
    Destination
    Total
    Paid
    Sat, 5 Apr 2014
    COMPANY NAME
    PICK UP POINT
    THE DESTINATION
    £100.00
    FALSE
    Is it possible for B7 to change colour if 2 weeks have passed from the date in B1 and Paid is still FALSE and green if it's TRUE?
    Many thanks.

    Hi NeoNapster,
    This may be a start. Conditional Highlighting of a cell that depends upon the values in other cells can be tricky, but we can work on that.
    Date
    Company
    Pick Up
    Destination
    Total
    Weeks
    Paid?
    OK?
    Sat 5 Apr 2014
    COMPANY NAME
    PICK UP POINT
    THE DESTINATION
    £100.00
    29.0
    FALSE
    Overdue by 29.0 weeks
    Sat 4 Oct 2014
    COMPANY NAME
    PICK UP POINT
    THE DESTINATION
    £100.00
    3.0
    TRUE
    OK
    Wed 1 Oct 2014
    COMPANY NAME
    PICK UP POINT
    THE DESTINATION
    £100.00
    3.4
    FALSE
    Overdue by 3.4 weeks
    Wed 8 Oct 2014
    COMPANY NAME
    PICK UP POINT
    THE DESTINATION
    £100.00
    2.4
    FALSE
    Overdue by 2.4 weeks
    Mon 20 Oct 2014
    COMPANY NAME
    PICK UP POINT
    THE DESTINATION
    £100.00
    0.7
    FALSE
    OK
    Sat 25 Oct 2014
    COMPANY NAME
    PICK UP POINT
    THE DESTINATION
    £100.00
    0.0
    FALSE
    OK
    Table with one Header Row
    Formula in F2 (Weeks) and Fill Down
    =DUR2WEEKS(TODAY()−A2)
    That shows the Duration in weeks from the Date in column A until TODAY. You can hide this column.
    Column G can contain the text TRUE or FALSE or could be checkboxes.
    Formula in H2 and Fill Down
    =IF(G2,"OK",IF(F2>2,"Overdue by "&F2&" weeks","OK"))
    IF a cell in G is TRUE, then insert "OK". No need for any more checking.
    Else IF a cell in F is greater than 2, then insert "Overdue by" and the number of weeks
    Else insert "OK" (the invoice is less than 2 weeks old).
    Conditional Highlighting of the Body Cells in column H. Select the cells.
    Add a Rule...
    text is
    OK
    Green Fill
    Add a Rule...
    text is not
    OK
    Red Fill.
    Column H with the Conditional Highlighting rules:
    OK?
    Overdue by 29.0 weeks
    OK
    Overdue by 3.4 weeks
    Overdue by 2.4 weeks
    OK
    OK
    (And I have just discovered that colours do paste into this forum ).
    Regards,
    Ian.

  • Internal comment - condition text in VK11 to make it mandatory

    hello,
    is it possible to make the internal comment in VK11 located in condition text menu as mandatory field.
    thanks in advance for the answer.

    Hi,
    As per configuration & SHD0 there seems to be no provision to make the billing header text mandatory.
    But if you still need to pass text in billing header, may be you can do this:
    Make the text mandatory in you preceding documents (eg: obligatory in order)
    Further mark the tick of reference mandatory in your billing header text procedure, & add to it an access sequence so that text gets copied into billing header.
    Additionally, you may also give a try to make the text entry screen in billing header greyed out thru SHD0.
    Hope this helps you.
    Regards,
    Dhananjay

  • Is it possible to make an alert message.

    Hi,
    Anyone knows if it Is possible to make an alert-message that pops up ( f.e as a little window) on a specific day to remember me of something I have to do that day?
    Would be handy.
    Is this possible with Tiger or is there a third party application that does the trick?
    Thanks in advance.

    Try a free widget called quikAlert
    http://www.apple.com/downloads/dashboard/business/qwikalert.html
    Regards
    TD

  • Is it possible to make a copy of the Leopard install DVD?

    Is it possible to make a copy of the Leopard install DVD? If so, is there a special way this has to be done? I just found out that we needed to use the Leopard install DVD to recover a complete backup from Time Machine after a recent hard drive failure. We have the family pack of Leopard, so I would like to keep the original at home and send a copy when my daughter goes off to college in case she needs to recover again. Her machine was originally a Tiger MacBook, so those install disks will not work. If it is not possible to copy the DVD, is there a way to create a bootable utility to do a time machine recovery?

    This half-solved my problem. I have had no problems creating a backup copy for my intel based computers, but non-intel based computers are problematic; a G5 powermac tower and a G4 Powerbook. Both with super drives for single density burning. Both have Leopard running, installed from an install disc purchased from Apple. However, neither will mount the copy, but intel based computers will. have burnt/burned with both toast 9 and Disc Utility. Discs won't mount and are "spit out" by the drive.
    Power Mac G5 OS X: 10.5.4
    Model Identifier: PowerMac7,3
    Processor Name: PowerPC G5 (3.0)
    Processor Speed: 2 GHz
    Number Of CPUs: 2
    L2 Cache (per CPU): 512 KB
    Memory: 1.5 GB
    Bus Speed: 1 GHz
    Boot ROM Version: 5.1.8f7
    Any thoughts?
    -Jim

  • I am trying to find out if I can change a setting of the calendar in my iPhone.   When I view calendar, in month, I would like to view it with the starting day of the week being Monday, not Sunday.  Is it possible to make this change? SS

    I am trying to find out if I can change a setting of the calendar in my iPhone. 
    When I view calendar, in month, I would like to view it with the starting day of the week being Monday, not Sunday.  Is it possible to make this change?

    Hello SMEvans32
    You can use iCloud to share the Calendar, that way she will always be up to date on that particular section of your work calendar. If you want to use iCloud, I would recommend backing up so you have a safe copy of your data.
    iCloud: Calendar sharing overview
    http://support.apple.com/kb/PH2689
    iCloud Setup
    http://www.apple.com/icloud/setup/
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • Top-Level Navigation Bar - Is it possible to make it 3 levels?

    Dear Portal Experts,
    Could someone please advise if it is possible to make the Top-Level Navigation Bar show more than 2 menu levels?  I looked at the document and it said we can only have 1 or 2 levels.  But I'm just wondering if there is any way around it.  Thanks.

    yes you are right .we can set only 1 0r 2 levels but good news is there is a workaround
    follow this blog
    Tag  Libraries: Creating a Hover Menu in SAP NetWeaver Portal
    reward points if helpful

  • Is it possible to make a type cast in TestStand?

    I've got the following problem.
    I use a receive function which waits for an undefined package. (struct package).
    The problem is i can't specify the module with the exaxt package.
    Generally in C i define a Pointer and create enough buffer for it. Is it the same in TestStand?
    Is it possible to make a type cast?
    for example:
    i've got these packages
    struct packet;
    struct  data;
    the function does not know which structure to receive.
    err = receive(buffer,maxlen);
    how do i specify the buffer variable?
    can i create a type "void" with a String to have enough buffer.
    and then to make a type cast, for example "Locals.dataobject = ((data)Locals.buffer)"
    any ideas?
    thx for help

    Unfortunately there is no way to do type-casts in TestStand. What you could do is write a wrapper-dll in C, that has for example two parameters for both possible structs. The dll then takes one of the parameters, does the typecast and passes it on to your original dll.
    From TestStand you can pass the struct(or better container in the "TestStand language") you want to use to the accoridng parameter of the wrapper-dll, leaving the other parameter empty or with some default-value.
    Hope this helps!
    André

  • Hi, can I move my iTunes library to an external hardrive without having to consolidate it as my prehistoric computer just doesn't have the space even though I have deleted everything possible to make room? Please help :(

    Hi, can I move my iTunes library to an external drive without having to consolidate it as my prehistoric computer just doesn't have enough space even though I have deleted everything possible to make room? Please help

    Hi, do you know if this works if I then want to move my library to a new computer as that is my main intention bacause my old computer hasn't got enough space for me to add new albums so I want to ditch the computer (its got to be about 100 years old and doesn't seem to cope well with modern technology!!) and start using my laptop for my iTunes. I am at the point now where i'm ready to throw both my computer and iPod out the window!!!! I might point out as well that in trying to clear space on my computer I accidently deleted the Bonjour programme which is aparently needed to use the home share option, oops!!!!
    Thanks, Kerry

Maybe you are looking for