Q. Reader-Writer lock across unrelated processes?

What mechanism would you suggest to implement Reader-Writer locks across unrelated processes?
Though the documentation for pthread_rwlock_ functions state
Synchronization Across Process Boundaries
Each of the synchronization primitives can be set up to be used across process
boundaries. This is done quite simply by ensuring that the synchronization variable is
located in a shared memory segment and by calling the appropriate init() routine,
after the primitive has been initialized with its shared attribute set as interprocess.
but they work only if the processes are forked off from a given process which initialized the relevant synchronization variable and not if the processes are totally unrelated.

What mechanism would you suggest to implement Reader-Writer locks across unrelated processes?
Though the documentation for pthread_rwlock_ functions state
Synchronization Across Process Boundaries
Each of the synchronization primitives can be set up to be used across process
boundaries. This is done quite simply by ensuring that the synchronization variable is
located in a shared memory segment and by calling the appropriate init() routine,
after the primitive has been initialized with its shared attribute set as interprocess.
but they work only if the processes are forked off from a given process which initialized the relevant synchronization variable and not if the processes are totally unrelated.

Similar Messages

  • Robust Reader Writer Locks?

    Does anyone know of an implmentation of robust reader/writer locks? (i.e. locks that unblock and return an error when the process that holds the lock dies) I found that Solaris supports robust mutex locks, but cannot find anything about robust reader/writer locks.
    Thanks for the help!
    Jason

    It doesn't sound like you have a good background in concurrency yet. Take a look at this book.
    http://java.sun.com/docs/books/cp/
    Great book, great guy. Let me know if you need any help after you start.

  • How to implement Reentrant Read Write Locking??

    It seems like there should be a ReentrantReadWriteLock in Coherence. Am I missing some basic concept or something?
    Thanks!

    Hi,
    there is no such thing as a shared lock on cache keys in Coherence out-of-the-box, at the moment, but it can be implemented on top of other features (with some performance decrease), but it is a fairly complex task, particularly the continuation of the client thread once the lock is acquired is tricky. Also that approach wouldn't be integrated with Coherence TransactionMap and JCA Adapter features, so in case you need such things you would need to reimplement those on top-of the custom read/write locking solution on your own.
    Best regards,
    Robert

  • Could not obtain a maintenance-read + write-Lock for DBQueue/QStream/jobID

    Hi All,
    Does anyone know what does this error mean?
    com.sap.b1i.xcellerator.XcelleratorException:
    XCE001 Nested exception: com.sap.b1i.xcellerator.RejectedException:
    XCE061 Could not obtain a maintenance-read + write-Lock for DBQueue/QStream/jobID Q.INB_IQ_INTQ_ASYN_QS.0010000000
    Regards
    Szymon

    You see that's the thing, I'm not using it for a picture camera. The camera prob wouldnt read the card anyway. I'm using it as a storage device for my Nintendo Wii, I have files that I put on there to use as channels for my Wii Home Screen.

  • FileStream locks read & write access. How can I get around this?

    I'm progressively downloading a video from a server using URLStream and FileStream classes to download and save the data to disk. While this is happening, I would also like to begin playback of the video so the user can progressively watch while this is happening. The player uses a standard FLVPlayback (version 2.5) control to load and playback videos. Unfortuantely, FileStream creates a read & write lock on the file and nobody has thus no one else can have access to it. This is a little bezarre to me because a read lock on a download is counter-intuitive, especailly for my application. I looked around the API docs but I could not find an option where I can manually set the locking mechanism on a file. Is this at all possible in Adobe AIR?

    nef9877 wrote:
    If I deathorise aall comuters and then re-authorise only the ones I want to use would this do it?
    Yes, that's how it's done.
    Read the warning about the number of times you can do this each twelve months. It can only be done so many times per year (I forget the exact wording).

  • How do I resolve this error message? The iPhoto library is on a locked volume.  Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library.

    How do I resolve this error message? The iPhoto library is on a locked volume.  Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library.

    Hi j,
    I don't know if this will work, but I'd try logging in to an admin account, going to your main library (not user library), opening it, opening Application Support, selecting iPhoto, hold down the command key and press i, click on the lock in the lower left, entering the password and making sure you have Read & Write privileges for System and Admin.

  • This message shows up when I try to access my auxiliary iPhone library: "The iPhoto library is on a locked volume. Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library."

    This message shows up when I try to access my auxiliary iPhone library: "The iPhoto library is on a locked volume. Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library."
    What did I do wrong?  I have been downloading all my photos into this same library since Janurary with no problems.

    What version of Mac OS X?
    Click the black Apple icon on the top left of the screen and select About This Mac. The next screen will show the information.

  • When i try and open the auto cad Lt that i just downloaded i get this error The directory may be locked by another process or have been set Read Only. Directory: '/Users/hockaday' Please correct this problem and press OK to exit the application.

    i get this error why i try and open the auto cad that i just downloaded
    The directory may be locked by another process or have been set Read Only.
    Directory: '/Users/hockaday'
    Please correct this problem and press OK to exit the application.

    I did install it in the admin account.  Actually the computer has four accounts, one for my husband, where I installed it.  One for me which also is set to admin, one is called TEST and has nothing in it and one is guest user.
    I don't know how AutoCad is interfacing with the account.  That is why I am not sure what to do about it.  I read other threads in various places and some seemed to point to something having to do with having multiple users.  The solutions were not clear.  I was hoping someone else had this problem and could tell me what to do.  I tried apple support but no help.  I have not tried AutoCad yet as I assumed they wont help since this is a free educational version of their product.

  • Granting read/write permissions on Oracle Server processes

    Hi
    I'm trying to set up a BFILE datatype in a table. I have created the directory and the current user has permissions to read and write to that folder. (The current user has the create any directory permission granted). The insert statement does not give an error but when I look at the table the BFILE column contains an error of <Value Error>.
    I suspect it may be because the current user does not have server read/write permissions on the directory I'm using. Can anybody help me with a correcting this please?
    Here is what I've used so far:
    CREATE or replace DIRECTORY pic_dir AS 'c:\temp'
    INSERT INTO picture (pic_id, filename)
    VALUES (1, bfilename('pic_dir', 'image1.jpg'))

    Many thanks for the reply.
    I am using the procedure as below (formats better if copied into Notepad). Gives me an error of "ORA-22285: non-existent directory or file for FILEOPEN operation" referring to the line containing the DBMS_LOB.FILEOPEN command.
    I suspect there is something wrong with the SELECT statement because I can get the procedure to run fine on the text file if I provide the BFILE location directly into the bfile_loc variable (as opposed to using the SELECT statement to retrieve it from the db).
    I created a directory: CREATE OR REPLACE DIRECTORY pic_dir AS 'C:\temp'
    I then created a table: CREATE TABLE picture (pic_id NUMBER, filename BFILE)
    Next I added a row: INSERT INTO picture VALUES(1, BFILENAME('pic_dir', 'testfile.txt'))
    CREATE OR REPLACE PROCEDURE read_bfile IS
    sep_char CONSTANT RAW(100) := UTL_RAW.CAST_TO_RAW(CHR(32));      --separating character (space)
    end_file CONSTANT RAW(100) := UTL_RAW.CAST_TO_RAW(CHR(10));      --end of file character (new line)
    bfile_loc BFILE;                               --pointer to BFILE
    cur_pos NUMBER := 1;                          --current position in file
    char_read BINARY_INTEGER := 0;                     --number of characters read
    read_buff VARCHAR2(500);                          --read buffer
    end_word NUMBER;                              --end of current word
    ret_val BOOLEAN := FALSE;                         --return value
    BEGIN
    select filename into bfile_loc from picture where pic_id = 1;
    DBMS_LOB.FILEOPEN(bfile_loc, dbms_lob.file_readonly);
    LOOP
    -- establish end of current word
    end_word := DBMS_LOB.INSTR(bfile_loc, sep_char, cur_pos, 1);
    -- process end-of-file
    IF (end_word = 0) THEN
    end_word := DBMS_LOB.INSTR(bfile_loc, end_file, cur_pos, 1);
    char_read:= end_word - cur_pos - 1;
    DBMS_LOB.READ(bfile_loc, char_read, cur_pos, read_buff);
    dbms_output.put_line(UTL_RAW.CAST_TO_VARCHAR2(read_buff));
    EXIT;
    END IF;
    -- read until end-of-file
    char_read:= end_word - cur_pos;
    DBMS_LOB.READ(bfile_loc, char_read, cur_pos, read_buff);
    dbms_output.put_line(UTL_RAW.CAST_TO_VARCHAR2(read_buff));
    cur_pos := cur_pos + char_read+ 1;
    END LOOP;
    DBMS_LOB.CLOSE(bfile_loc);
    END;

  • ICalExternalSync locks up my system with disk read/writes -  any fixes?

    When I allow ICalExternalSync to run it completely hangs up my system by hogging a gig of real memory and nearly 3 gigs of virtual memory. It also floods the system with continuous disk read/writes - which stop immediately when I quit the process.
    I've learned to shut ICalExternalSync down in "Activity Monitor" as soon as I've synced my calenders.
    Anyone else have this problem and a fix?

    I thought so too, but after doing that, the total download size for the updates was bigger than the space left. It was 2.8 gigs of downloads, and the root partition was 5.6 gigs full out of 7.56 gigs.
    I've never experienced such a huge update before! It's been a few hours and i'm still fixing it. There's literally hundreds of thousands of files that are now giving me "file exists in filesystem" errors so i'm making a script to delete all of those.
    To get an idea of how many files there was, i outputted the errors to a file, opened it up with less, then pressed and held page down for almost 2 minutes, didn't reach the bottom, so ended up just pressing end.
    Anyways, I'm going to post the scripts so it in case anyone encounters this critical problem, they can follow some simple instructions and be on their way.

  • Is it possible to change the read/write permissions on a time machine back-up of iTunes? I need to restore it, but old version is locked....

    Is it possible to change the read/write permissions on a time machine back-up of iTunes? I'm needing to restore it as my phone deleted half our playlists during sync  & am not seeing a way to unlock the permissions. I have the current version unlocked, but can't seem to get the backed-up version. When I click on restore I get a pop-up that says iTunes can't be deleted as it is part of the OS. I'm not even trying to delete, just restore the old version. Any suggestions?

    Hmmm, ok I'll give it a shot. I've always had the iTunes sync w/ my phone set up to only load selected playlists to the phone b/c there's a lot more in iTunes than I have room or desire for on my phone. A few months back I started having trouble w/ trying to sync everything & subsequently adding more to the phone than it could hold. The quickest thing at the time was to unclick the sync music option in iTunes so I could still backup the phone to the computer & not have a problem.
    When I asked about it during one-to-one session shortly after, they advised me to delete the music off my phone & then re-sync it to the computer, run a backup of the phone & redownload the music to the phone. When I tried this it ended up deleting all my playlists (but not my husband's) from iTunes. Irritating, but I've been rebuilding the playlists since. I had also unclicked sync music again & an Apple person told me the most likely best fix was to delete & reload iTunes completely.
    A few days ago I realized I hadn't backed up the phone to the computer in over a month so after deleting & reinstalling iTunes, & w/o changing anything (sync music was STILL unchecked) I ran a backup & my phone went from having 4 GB free space to being 2 GB over capacity due to iTunes trying to download the entire music library to the phone. I made a one-to-one appt again & it was suggested AGAIN that I delete all the music off my phone & then resync it to the computer & redownload the music. We did this (though a few random songs that had previously been purchased somehow remained on the phone), I got home, connected the phone & instead of the music that shows  as 'on my device' disappearing from iTunes it just sat there, so, as the guy had told me I MIGHT have to do, I threw all those songs showing in iTunes as being on my phone, in the trash so that it was completely clear.
    At this point I checked sync music, made sure the options were 'selected playlists only', checked the ones from my own list that I wanted (I usually have one playlist of comedians from my husband's folder that I also have on the phone, but didn't check it at this point). It uploaded all my stuff just fine, but for whatever reason when it saw that I wasn't uploading that comedy playlist any longer, it not only didn't upload it but proceeded to delete my husband's entire folder of playlists from iTunes. -_- I got on the phone w/ an Apple support person right away but he wasn't able to tell me anything .. basically said we'll have to rebuild everything. I asked about the possibility of using time machine, he said he's not qualified to answer that, so that's when I started looking around online & found, among others, the link I referenced a couple replies ago.
    I hope this all makes sense. It's been a long-term issue so I'm trying to go from memory as I figured to begin w/ that I had just made a mistake somewhere, so didn't try to document anything. Now w/ it having happened a 2nd time, I'm not sure if it was 'user error' or something else.......

  • Installing Mountain Lion from Snow Leopard, Install failed and HD write-locked

    I recently downloaded the mountain lion installer from the App Store and I ran the installer. Stupid person as I am, I did not have any backups for my file and I naively assumed that an apple OS installer would be without flaws. Boy, was I wrong. I need every bytes of my data (or close to every bytes) but the installer failed.
    Mid installation, the installer stopped and said that the installation failed and that I need to repair my disk. So I restarted the computer and I ran disk utilities (my start up disk was the OS installer and the installer allows me to run several programs, including terminal, disk utilities, and by the way, when I held option while starting up to see which start up disks I have, I only had the OS installer as the start up disk. Also, the installer allows me to run a program called "Startup Disk" when I click on the apple logo on the top left corner, but it doesn't allow me to startup my computer using Macintosh HD) and noticed that when I highlighted Macintosh HD, my "Repair Disk" button was grayed out. So first things first, I ran the "Verify Disk" button but after a minute or so, Disk Utilities said that verification failed and that Macintosh HD needs to be repaired. But the "repair disk" button is grayed out! So I went to the Mountain Lion installer again and ran it. Of course, it failed again so I restarted the computer.
    So I tried to first back up all files in Macintosh HD to an external hard drive using Disk Utilities, and I used features such as "New Image" and "Restore" but they both ended up in "Input/Output error". I tried many methods with Disk Utilities but they resulted in errors.
    After some research, I noticed that some people's computers worked after they reset their PRAM. So that's what I did. I held command+option+P+R when computer started up and I reset the PRAM. When the start up disk (which is the OS installer, not the normal operating system) loaded, I was greeted with choose languages option and then I was back in the Mountain Lion installer state. I again ran the installer again, hoping something would be different, but then it was different. But not in a good way. When I was told to choose where I would like to install Mountain Lion, I noticed that Macintosh HD was grayed out. Last time, I was at least able to run the installer but this time, Macintosh HD was grayed out. The installer said that my Macintosh HD was locked. After some research, I learned that apparently, the Mountain Lion installer write-locks Macintosh HD mid installation.
    So now I am stuck and I am thinking of two things (plus some questions)
    1. I am wondering if there is a way to unlock Macintosh HD. But even if I can unlock Macintosh HD, there is no guarantee that the installer will successfully install Mountain Lion, am I right?
    a. so how can I un-write-lock Macintosh HD?
    2. More realistically, I am thinking of borrowing someone else's macintosh computer and use it as the backup center. I have a firewire cable and a terrabyte external hard drive. So what I'm thinking is that I'll hook my computer in target mode to my friend's computer and I will also plug in my external hard drive to my friend's computer and then I can download and run Carbon Copy Cloner from my friend's computer to copy all data from my Macintosh HD to my external hard drive. And then I will erase my Macintosh HD, freshly install Mountain Lion onto it and then copy all data back from my external hard drive. But I am not sure about few things.
    a. it looks like my Macintosh HD is write-locked. Can I still use Carbon Copy Cloner to copy all data from Macintosh HD (in target mode) to my external hard drive?
    b. will my computer allow me to erase (or format) Macintosh HD?
    c. will my erased/formatted Macintosh HD able to install + be installed Mountain Lion OS?
    If you are here, then you have read my long long problem. Thank you very much and I would really really really appreciate your answers and opinions. Thanks

    I'm not sure where you read that about the disk being "write-locked." That doesn't make much sense, given that the major task an installer like this must achieve is writing a whole bunch of files to the hard drive. I think your source was mistaken.
    As to what happened, it sounds like your hard drive was badly corrupt to start with, or possibly was on the edge of failing and is now in the process of dying entirely. If you don't have backups of your data, that does not bode well for you, unfortunately. If you can manage to use target mode to copy your data, do that.
    Once you're sure you've got all your data, you need to start up from your Snow Leopard install disk and repair the hard drive. (Since it sounds like the Mountain Lion installer didn't work, I wouldn't trust the recovery partition that Mountain Lion installs.) Or, even better, just erase the hard drive entirely and reinstall Snow Leopard. Then, once you're back up and running, with all your data back on the system and with Snow Leopard updated to the most recent version, try installing Mountain Lion again. If any of that fails again, the problem is likely to be a dying hard drive, and you'll need to replace it.

  • Semaphores in LV 5.1 ?? across different processes??

    Urgent!
    I have a very large and complex application, which I need to build into an executable.
    I need to have data from one or more files, which this exe writes periodically, available to another separate application.
    I need to protect the file from read during write and
    vice-versa, so was thinking of semaphores which I'm using inside the large app.
    So, I ran a trial.
    ( OS is NT4 and NT 5)
    Created two different (but identical except for vi name) VIs which each create, acquire, release, and destroy a semaphore of the same name.
    (the name comes from a global to ensure it is in fact the same.)
    They both work ok.
    One waits for the other to release the semaphore before proceding.
    Then I built an exe from
    each with app builder.
    Each of the exe's can create, acquire and destroy its
    own semaphore without affecting that of the other app.
    (Even though the semaphores are named the same.)
    All the info I can find on the LV semaphores indicate that they are just like mutexes except that they can be shared by more than one task (set by "size" input of the create semaphore vi).
    According to microsoft documentation, Mutexes and semaphores are kernel objects which can be used to synchronize across multiple processes(, threads, or tasks).
    So what gives? Is the implementation in LV different
    than the Windows kernel?
    Anyone have any ideas?
    Thanks
    Dave

    Semaphores are similar in behavior to mutexes but are not system mutexes;
    they rely on
    LabVIEW occurences which are local to the application.
    To solve your problem you could open files denying read/write access to
    other. Then if a file is already in use, other applications will receive
    access error when attempting to open the file.
    HTH
    Jean-Pierre Drolet
    "Dave Karon" a ecrit dans le message de news:
    [email protected]..
    > Urgent!
    > I have a very large and complex application, which I need to build
    > into an executable.
    > I need to have data from one or more files, which this exe writes
    > periodically, available to another separate application.
    > I need to protect the file from read during write and
    > vi
    ce-versa, so was thinking of semaphores which I'm using inside the
    > large app.
    > So, I ran a trial.
    > ( OS is NT4 and NT 5)
    > Created two different (but identical except for vi name) VIs which
    > each create, acquire, release, and destroy a semaphore of the same
    > name.
    > (the name comes from a global to ensure it is in fact the same.)
    > They both work ok.
    > One waits for the other to release the semaphore before proceding.
    > Then I built an exe from each with app builder.
    > Each of the exe's can create, acquire and destroy its
    > own semaphore without affecting that of the other app.
    > (Even though the semaphores are named the same.)
    > All the info I can find on the LV semaphores indicate that they are
    > just like mutexes except that they can be shared by more than one task
    > (set by "size" input of the create semaphore vi).
    > According to microsoft documentation, Mutexes and semaphores are
    > kernel objects which can be used to synchronize across multiple
    > processes(, threads, or task
    s).
    > So what gives? Is the implementation in LV different
    > than the Windows kernel?
    > Anyone have any ideas?
    >
    > Thanks
    > Dave
    LabVIEW, C'est LabVIEW

  • Oracle coherence first read/write operation take more time

    I'm currently testing with oracle coherence Java and C++ version and from both versions for writing to any local or distributed or near cache first read/write operation take more time compared to next consecutive read/write operation. Is this because of boost operations happening inside actual HashMap or serialization or memory mapped implementation. What are the techniques which we can use to improve the performance with this first read/write operation?
    Currently I'm doing a single read/write operation after fetching the NamedCache Instance. Please let me know whether there's any other boosting coherence cache techniques available.

    In which case, why bother using Coherence? You're not really gaining anything, are you?
    What I'm trying to explain is that you're probably not going to get that "micro-second" level performance on a fully configured Coherence cluster, running across multiple machines, going via proxies for c++ clients. Coherence is designed to be a scalable, fault-tolerant, distributed caching/processing system. It's not really designed for real-time, guaranteed, nano-second/micro-second level processing. There are much better product stacks out there for that type of processing if that is your ultimate goal, IMHO.
    As you say, just writing to a small, local Map (or array, List, Set, etc.) in a local JVM is always going to be very fast - literally as fast as the processor running in the machine. But that's not really the focus of a product like Coherence. It isn't trying to "out gun" what you can achieve on one machine doing simple processing; Coherence is designed for scalability rather than outright performance. Of course, the use of local caches (including Coherence's near caching or replicated caching), can get you back some of the performance you've "lost" in a distributed system, but it's all relative.
    If you wander over to a few of the CUG presentations and attend a few CUG meetings, one of the first things the support guys will tell you is "benchmark on a proper cluster" and not "on a localised development machine". Why? Because the difference in scalability and performance will be huge. I'm not really trying to deter you from Coherence, but I don't think it's going to meet you requirements when fully configured in a cluster of "1 Micro seconds for 100000 data collection" on a continuous basis.
    Just my two cents.
    Cheers,
    Steve
    NB. I don't work for Oracle, so maybe they have a different opinion. :)

  • Deliver file with read/write properties on target side using receiver file

    Hi All,
    Our file-to-file scenario works fine. By default, PI creates file on target directory with the 644 permissions. Files coming inbound from PI are not read/writable to the group. Currently the files from PI are coming across with 644 permissions and they should be 664 or 660. Is there a way to generate read/write files on targer side using SAP PI??
    Thanks in advance,
    - Riya Patil

    Hello,
    Try using Run-Operating system command after processing parameter with the below mentioned command:
    chmod 0755 /usr/sap/tmp/test/*
    where:  /usr/sap/tmp/test/ is the directory path location.
    Br,
    Rahul

Maybe you are looking for

  • Header and Footer in Block ALV Display

    Hi All, My requirement includes to ALV Block List Display with header and footer. I have made two forms TOP_OF_PAGE and END_OF_PAGE . I have pass the form and name of event to an internal table it_events. This it_events[] is then passed to FM ' REUSE

  • How to print BARCODE in DATAMAX Printer using SAP Script?

    Hi, Can anybody guide me how to print BARCODE using DATAMAX Printer? I need to develop a SAP Script, through which i need to print the BARCODE. Pls. let me know the parameters for Script and how to print using print program..... Regards, Hemant

  • BAPI or FM for Customer Edit XD02

    Hi gurus, Does anyone know if there is a BAPI or FM for updating customer master data (XD02) without resorting to BDC/LSMW processing ?.  I have tried BAPI_CUSTOMER_CHANGEFROMDATA1 but it seems nobody knows which are the mandatory fields. I have read

  • Migration from old pc now in new user how do i fix

    I migrated from my old pc to a my imac.  Now it is in a new user but I want to merge the two together.  Any suggestions?

  • Deploying with apache

    Hi, I'm trying to deploy a test java ME application to my mobile phone via my own apache web-server. I have configured the server with the mime-types and the jar downloads correctly to the phone but at the end of the download it says server-error whe