Reading image stream with multiple threads

Hello folks
I thought about a model for an app I need to code and I need your opinion.
My task is to implement an application that does the following:
- Read and decode images from a stream.
- Do some image processing
- Display the resulting images in Swing window.
Since decoding is expensive and i might want to use a multiprocessor machine,
I decided to put the image reading and decoding in a different thread. from the
image processing (and maybe painting).
In the end, I thought about using 2 objects and 3 threads:
- one object that keeps the Swing window data and the image processing logic
- one object that keeps the stream connection data and the decompression logic
for the (jpeg) images
-one thread that waits for incoming events and decodes them. After decompressing
one image, it sends an event to all objects that needs the image data, in this case
this is the object that keeps the image processing logic. Therefore it updates an
image reference in the image processing logics object. The image object only
allow synchronized access by all threads.
-another thread whose logic is inside the image processing logic object takes
the current data from the image reference the first thread writes to via events
and does image processing. The result is written to another image reference within
the same object. After that, it sleeps for 10 ms or so.
-a third thread is triggered via invokeLater by the image processing thread after
it produced a result. It calls the repaint() method of the Swing control which draws
the result-image to the screen.
Do you see any mistakes or do you have better suggestions to do it?
Please let me know!
Thanks in advance!

If the file is on a diskdrive, it's likely that your program will be i/o bound and threads won't help.
Edited by: ChuckBing on Jul 2, 2008 11:32 AM

Similar Messages

  • Read ini file with multiple threads

    I have a state machine architecture, but I have multiple threads. For instance, one is dealing with listening for mulitple tcp connections and storing their refnums to an array in a functional global. Another thread is accessing these refnums and collecting data it's receiving from each tcp connection. This data is queued up and then dequeued in a third thread which does some modification and sends it out via serial. My question is, when you have a situation like this and have to read an ini file, where should you read it? It seems like the most logical place would be outside your loops so you can get all the tcp and serial info (port, baud rate, etc) then wire it it to your create listener or initialize serial connection despite them being in different threads. But then again, normal state machine architecture would want an "initialize" case. If you did this though which loop would you put the init case in? And you would then have to worry about synchronizing loops becuase you wouldn't want one to try and create a listener while another thread was still reading ini data which would include the port to listen on. Maybe I'm overthinking this haha. Suggestions? Edit: one more question. Does it seem overkill that I have a tcp loop listening for data and queuing it up and a separate loop sending out the processed data via serial? Or should I just have one state that gets tcp data stores it in a shift register, then another state that sends it out via serial, and returns the state machine to the tcp read state?
    Message Edited by for(imstuck) on 03-03-2010 01:13 PM
    Message Edited by for(imstuck) on 03-03-2010 01:17 PM
    CLA, LabVIEW Versions 2010-2013

    Most of the applications I work on at the moment are used for testing barcode and label printers. The test applications I design are focused on testing the printer's firmware, not the hardware. Within our applications we have three primary objects (Unfortunately they are not native LabVIEW objects yet. They were developed before native LVOOP.) The primary objects we use in our applications are a log object, a connection object (communication interface to the printer) and a printer object. In any single instance of a test we only have a single printer, a single connection to the printer and one or more discrete logs. Each instance of these objects represent a single, real physical entity. A singleton object is a virtual representation of the physical world. Let's take the log object since that is the most simple of the objects described above. Naturally for a given log file you have the log file name and path. We also provide other attributes such as the maximum size of a single file (we allow log files to span multiple files), whether it is a comma delimited file or if it contains raw data, if timestamps should be included with a log entry and so forth. Most of these attributes are static for a log file with the exception of the name and such things as whether the logging is actually enabled or disabled. If we split a wire and had multiple instances of the log file (the way native LVOOP actually works) the attribute for whether logging is currently enabled or disabled will only pertain to the specific instance, or specific wire for the that object. Since this truly represents a single item, one log file, we need that attribute to be shared for all references to the instance of the log object. Since we allow this we can set an attribute on the log object in any task and it will be reflected in any other task that is using it. Think of the way a action engine or functional global works. However, in this case we provide discrete methods for the various actions.
    I hope that made some sense. If not let me know since I just whipped up this response.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Reading a file with multiple threads?

    I have a file that contains some data. In my application, I currently have three worker threads that perform the same long-executing task using three different data sets. They each need to read some data from the same file. Is this a problem as long as they are only reading it? I know it would be if they modified it but I didn't think it was a problem if they were only reading it.
    Edit: It is an XML file and I am using the XML Decoder to read it.
    Edited by: Sch104 on Jul 2, 2008 9:08 AM

    If the file is on a diskdrive, it's likely that your program will be i/o bound and threads won't help.
    Edited by: ChuckBing on Jul 2, 2008 11:32 AM

  • How do you disable "Run with Multiple Threads" in a standalone EXE

    I have a program written in Labview 6.1.  After moving to a different hardware platform, my program has started crashing at the same point every time it is run.  I eventually found out that the cause of the crash is the fact that the new hardware has a dual core processor.  I confirmed this by disabling "Run with multiple threads" and now the program works fine.  What I need to know now is how to disable the same setting in a built EXE file, since as far as I know the "Run with multple threads" setting only affects execution in the Labview Dev environment.
    Thanks for any help,
    Dave

    Greg McKaskle once posted that using a non-reentrant (VI is NOT re-entrant) wrapper VI to make the calls to the dll will prevent simultaneous execution of the dll.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Problem with multiple threads accessing the same Image

    I'm trying to draw into one Image from multiple threads. It works fine for a while, but then suddenly, the image stops updating. Threads are still running but the image won't update. I'm using doublebuffering and threads are simply drawing counters into Image with different speed.
    It seems like the Image gets deadlocked or something. Anyone have any idea what's behind this behavior or perhaps better solution to do such thing.
    Any help will be appreciated.

    Sorry Kglad, I didn't mean to be rude. With "No coding
    errors" I meant the animation itself runs with no errors. I'm sure
    you could run the 20 instances with no freezing (that's why I put
    the post :) ) But I'm affraid it is an animation for a client, so I
    cannot distribute the code.
    Perhaps I didnt explain the situation clearly enough (in part
    because of my poor english...).-
    - By 20 instances I mean 20 separated embedded objects in the
    html
    - The animation is relatively simple. A turned on candle, in
    each cycle I calculate the next position of the flame (that
    oscilates from left to right). The flame is composed by 4
    concentric gradients. There is NO loops, only an 'onEnterFrame'
    function refreshing the flame each time.
    - It's true that I got plenty variables at the _root level.
    If that could be the problem, how can I workaround it?
    - It is my first time trying to embed so many objects at the
    same time too. No idea if the problem could be the way I embed the
    object from the html :(
    - The only thing I can guess is that when a cycle of one of
    the object is running, the other 19 objects must wait their turn.
    That would explain why the more instances I run, the worst results
    I get. In that case, I wonder if there's a way to run them in a
    kind of asynchronous mode, just guessing...
    Any other comment would be appreciated. Anyway, thanks a lot
    everybody for your colaboration.

  • Streams with multiple writers

    Here is a conundrum I've been unable to solve:
    How do multiple threads write to a PrintWriter, and then disconnect without killing each other?
    Here's the long version:
    Consider a thread with two pipes:
    PipedInputReader p1in = new PipedInputReader();
    PipedOutputWriter p1out = new PipedOutputWriter(p1in);For speed, efficiency, and the desire to use the readline() method, this thread wants to wrap the input with a buffer:
    BufferedReader in = new BufferedReader(p1in);Now, this thread wants to give access to the other end of the pipe to someone else, and wrap it in a BufferedWriter. In turn, that will be wrapped in an autoflushed PrintWriter so that we can use the println() method:
    PrintWriter out = new PrintWriter(new BufferedWriter(p1out), true);Now we just need to give that to the outside world:
    public PrintWriter getBuffer() {
    return out
    }Putting it all into a complete class (that may not be runnable due to typos; I'm doing this by hand), we get the following:
    class buf implements Runnable {
      private PrintWriter out = null;
      public PrintWriter getBuffer() {
        return out
      public void run() {
        PipedInputReader p1in = new PipedInputReader();
        PipedOutputWriter p1out = new PipedOutputWriter(p1in);
        BufferedReader in = new BufferedReader(p1in);
        PrintWriter out = new PrintWriter(new BufferedWriter(p1out), true);
        String text = "";
        while ( (text = in.readline()) == true ) {  ;;;; }
      }Of course, toss in the try/catch blocks and all that. I probably missed a keyword here and there; eclipse does that for me :)
    Now, this works remarkably well. 20 threads can call getBuffer on that thread and write to it, and everything is synchronized nicely. It really does work well enough for my needs.
    However, when one of those threads exits, all the pipes close and everyone dies.
    Say I have another thread that does the following:
    PrintWriter xx = thethreadabove.getBuffer();I would think that somewhere along the line, when that thread is done, I can just do:
    xx = null;And let the thread exit. I'd be wrong, however. It makes everything die. So, what can I do?
    How can I have multiple writers with just a single reader? I am not locked into pipes wrapped by bufferedwriters wrapped by printwriters; they just provide what I need with little issue. I'm guessing someone will tell me at some point that I was supposed to use a queue of some sort (arrayblockingqueue, etc.), and I'm sure that might work with enough spit and tape. Streams should work too, though, shouldn't they? I should be able to remove one of many references to a PrintWriter without killing the underlying pipe, right?

    Ok, so here's what I found. First, I had the reader thread export a PrintWriter by doing the following:
    private MyBuffer outside
    public ReaderThread() {
      outside = new MyBuffer(new BufferedReader(pipe))
    public PrintWriter getBuffer() {
      outside.register();
      return (new PrintWriter(outside))
    }The MyBuffer class is then:
    public class MyBuffer extends FilterWriter {
      private int count = 0;
      public MyBuffer(Writer w) {
        super(w);
      public void register() {
        ++count;
      public void close() {
        --count;
        if (count <= 0)
          super.close();
    }I couldn't for the life of me get that close method to be called. Even if I called it manually, things still fell apart, because after about 1 second, the pipe would close.
    Here's what I found:
    Pipes have a nice undocument / poorly documented feature wherein they will close 1 second after the last thread that wrote to the pipe exits. Crazy, eh? Pipes expect one and only one thread to do the writing, and have a rather lousy mechanism for even achieving that goal (proven by how I worked around it). They record the thread id of the last thread to write to the pipe. So if I have the aforementioned 20 worker threads that all get a pointer to the printwriter encapsulating the buffer encapsulating the pipe, and they each write to the printwriter, each write will change the value of the thread id that the pipe is looking for. If one of those threads dies and is listed as the last thread to conduct a write, then the whole pipe shuts down, causing a ripple effect of broken pipes.
    This is a very inneffective design, and even the source code for the java sdk contains comments saying that there should be a better way. Until that ever gets fixed, I'm left with having to signal another thread to do a write before the dying thread can terminate. This is not very safe in the case of a real problem with a given thread, but at least it works in terms of the "go-path".
    Craziness.
    If anyone can think of a good way to handle this, I'm open. I'm thinking write now that I need a separate thread to do the watching, and dying threads need to signal that thread to take over as the "last writer". Either that, or maybe work up an event listener to trigger on every write. I really don't know. This is disappointing really.

  • Please help me with multiple threads

    I don't understand much about multiple threads, so can anyone help me with this? can you show me a small simple code about multiple threads?

    Do you understand much about google? yahoo?

  • How to proces the record in Table with multiple threads using Pl/Sql & Java

    I have a table containing millions of records in it; and numbers of records also keep on increasing because of a high speed process populating this table.
    I want to process this table using multiple threads of java. But the condition is that each records should process only once by any of the thread. And after processing I need to delete that record from the table.
    Here is what I am thinking. I will put the code to process the records in PL/SQL procedure and call it by multiple threads of Java to make the processing concurrent.
    Java Thread.1 }
    Java Thread.2 }
    .....................} -------------> PL/SQL Procedure to process and delete Records ------> <<<Table >>>
    Java Thread.n }
    But the problem is how can I restrict a record not to pick by another thread while processing(So it should not processed multiple times) ?
    I am very much familiar with PL/SQL code. Only issue I am facing is How to fetch/process/delete the record only once.
    I can change the structure of table to add any new column if needed.
    Thanks in advance.
    Edited by: abhisheak123 on Aug 2, 2009 11:29 PM

    Check if you can use the bucket logic in your PLSQL code..
    By bucket I mean if you can make multiple buckets of your data to be processed so that each bucket contains the different rows and then call the PLSQL process in parallel.
    Lets say there is a column create_date and processed_flag in your table.
    Your PLSQL code should take 2 parameters start_date and end_date.
    Now if you want to process data say between 01-Jan to 06-Jan, a wrapper program should first create 6 buckets each of one day and then call PLSQL proc in parallel for these 6 different buckets.
    Regards
    Arun

  • How to read Images associate with Purchase Requisitions and its Line Items

    Hello,
    My scenario: i need to read the Images associated with PR and its line items and pass them as Idoc FM.
    Any idea where are these images stored in the SAP table or they just available till runtime
    Regards,
    Abhishek

    You can have a look at the link here [GOS Contents|http://help-abap.zevolving.com/2009/02/generic-object-services-gos-toolbar-part-5-get-note-attachment-contents/]
    Please note that in your case if its attachments only then pass la_relat-low = 'ATTA*'. if there is no filtering then pass 'NOTE', 'URL', 'ATTA' as required.
    For the business object of PR pass BUS2105 and instance id pass the PR no.
    The tables related to this are srrelroles,srgbinrel,sood etc.

  • SQL Toolkit crashing with multiple threads

    Hello everyone and Happy New Year!
    I was hoping someone might be able to shed some light on this problem. I am updating an older application to use multiple threads. Actually the thread that is causing a problem right now is created by using an Asynchronous timer.
    I am using CVI 2010, and I think the SQL toolkit is version 2.2.
    If I execute an SQL statement from the main thread, there is no problem.
    stat = DBInit (DB_INIT_MULTITHREADED);
    hdbc = DBConnect( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=sample.mdb;Mode=ReadWrite|Share Deny None" );
    hstmt = DBActivateSQL( hdbc, "SELECT * FROM SAMPLES" );
    DBDeactivateSQL(hstmt);
    DBDisconnect(hdbc);
    If I add code to do the same functions in a timer callback, it causes a stack overflow error.
    .. start main thread
    stat = DBInit (DB_INIT_MULTITHREADED);
    NewAsyncTimer (5.0, -1, 1, &gfn_quicktest, 0);
     .. end main thread
    .. and then the timer callback
    int CVICALLBACK gfn_quicktest (int reserved, int timerId, int event, void *callbackData, int eventData1, int eventData2)
    int hdbc = DBConnect( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=params\\sample.mdb;Mode=ReadWrite|Share Deny None" );
    int hstmt = DBActivateSQL( hdbc, "SELECT * FROM SAMPLES" );
    DBDeactivateSQL(hstmt);
    DBDisconnect(hdbc);
    return 0;
    The program crashes with a stack overflow error when the DBActivateSQL statement is called.
    I understand that the ODBC driver for Access may not support multithreading, but I am only connecting to that database from the same thread with those 2 statements only so it should be fine ?
    Any insight would be appreciated,
    Thanks,
    Ed.
    Solved!
    Go to Solution.

    I just tried this using the sample access database that comes with CVI. It uses a DSN instead of mdb. It worked fine though. I don't see any reason multithreading would be a problem here if you are opening and closing the connection in the same code segment. I do notice that you are using params in the asyn callback connection string. Where does this come from? Maybe try using the sample database and see if that works.
    National Instruments
    Product Support Engineer

  • UdpClient with multiple threads using ReceiveAsync get the same buffer

    Hello,
    First let me give you the premise that I am working under... I am hoping to have multiple receive threads to make sure that I am pulling data off the port as quickly as possible and am hoping to do this efficiently through using asynchronous functions.
    I have two simple applications which I will include the code of below, one that uses 4 ReceiveAsync threads and another that sends data out, very quickly. I am finding that the data that I receive is not the same as what I sent. For instance I receive the
    same packet twice and others not at all. I get the output from my receive client:
    Receive client running...
    Packet 1 - 02-FF-FF-FF-FF-FF
    Packet 2 - 03-FF-FF-FF-FF-FF
    Packet 3 - 01-FF-FF-FF-FF-FF
    Packet 4 - 01-FF-FF-FF-FF-FF
    Notice that packet starting with 00 is missing and instead i have two 01s... Sometimes when I run all 4 packets start with 03. I have verified that all 4 packets are correct on the receive machine using Wireshark.
    Can anyone help me figure out why I am getting the right number of continuations from ReceiveAsync with the wrong packets?
    The Sender:
    class Program
        static int numberOfPktsToSend = 4;
        static void Main(string[] args)
            var localEP = new IPEndPoint(IPAddress.Parse("192.168.209.1"), 47000);
            var remoteEP = new IPEndPoint(IPAddress.Parse("192.168.209.133"), 47000);
            UdpClient client = new UdpClient(localEP);
            Parallel.For(0, numberOfPktsToSend, (x) =>
                client.SendAsync(new byte[] { (byte)x, 0xff, 0xff, 0xff, 0xff, 0xff }, 6, remoteEP);
                Console.WriteLine(string.Format("Sent {0}", x));
            Console.ReadLine();
    Note: I padded it with 0xff just to make the packets a little bigger.
    Receiver:
    class Program
        public static UdpClient client;
        public static CancellationTokenSource cts;
        private static int NumberOfReceiveThreads = 4;
        static int packetCount = 1;
        static void Main(string[] args)
            cts = new CancellationTokenSource();
            var localEP = new IPEndPoint(IPAddress.Parse("192.168.209.133"), 47000);
            client = new UdpClient(localEP);
            for (int i = 0; i < NumberOfReceiveThreads; i++)
                Task.Run(() => { myReceiveAsyncThread(); });
            Console.WriteLine("Receive client running...");
            Console.ReadLine();
            cts.Cancel();
        static async void myReceiveAsyncThread()
            var threadId = Task.CurrentId.ToString();
            while (!cts.IsCancellationRequested)
                try
                    var data = await client.ReceiveAsync();
                    Console.WriteLine(string.Format("Packet {0} - {1}", packetCount++, BitConverter.ToString(data.Buffer)));
                catch (Exception e)
                    Console.WriteLine("Something bad happened...");
    Thank you for your help!

    Hello Robbie,
    >>Can anyone help me figure out why I am getting the right number of continuations from ReceiveAsync with the wrong packets?
    Please have a try to use only one thread to read these byte stream as:
    cts = new CancellationTokenSource();
    var localEP = new IPEndPoint(IPAddress.Parse("10.168.196.246"), 47000);
    client = new UdpClient(localEP);
    //for (int i = 0; i < 1; i++)
    Task.Run(() => { myReceiveAsyncThread(); });
    Console.WriteLine("Receive client running...");
    Console.ReadLine();
    cts.Cancel();
    In your original code, there are multi threads seems to result a repeat read behavior.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Servlet with Multiple Threads spawned automatically

    Hi,
    I have a problem involving threads in servlet as follows:
    Scenario: I am working on developing a web application using Tomcat and Netbeans IDE. I have a servlet which gets values from the session object and then constructs a server-side object and invoke a method on the same. This method on the server-side object executes an INSERT query in the mysql database.
    Problem Description: The INSERT query is invoked twice => the method on the server-side object is invoked twice, and 2 records with different keys are created in the database table.
    Observation: When I used the debugger in the IDE, I discovered that there are 2 different threads that are getting spawned (which I did not design/code for) and these threads call the insert query on the table twice.
    I am not sure why this is happening. Can someone please throw some light on this?
    Thank you in advance.

    The servlet has a number of multiple if-else blocks. In the last if-else block of the servlet code, I am getting some attributes from the session object, creating the server class object and setting the attributes of the object.
    The 2-thread problem is occurring only when the the last block is reached. The 1st thread creates the server class and the 2nd thread executes the rest of the lines in the servlet and completes the INSERT query. This is followed by the 1st thread to insert a new record again.

  • High Speed Streaming with Multiple FPGA FIFOs and TDMS Advanced Asynchronous (Data Ref)

    I am using an FPGA with adapter card (7962 with 5751) for data acquisition and signal processing. I have adapted the FlexRio example "High Throughput Streaming," which works very well for a transferring data from the FPGA via a single FIFO. This example uses the TDMS Advanced Asynchronous Write (Data Ref). The "High Throughput Streaming" example is similar to "Streaming External Data to a TDMS File (Windows)" but includes more code to prep the FIFO buffer size and TDMS size.
    My question is how can I adapt this code to incorporate multiple FIFOs that write data to different channels in the TDMS file? Can I use multiple instances of  TDMS Advanced Asynchronous Write (Data Ref) in a single VI for each FIFO Acquire Read Region? If so, how do I insure that the correct data is written to the correct channel in the TDMS file?

    Thank you DeppSu for your explanation, I will look into that.
    But first, I want to be sure that the FPGA and the Hot general designs are correct, which for the moment I am not sure. So I have included my code.
    I tried the Host vi several times, and it seems that it works sometimes and sometimes not, like there are some communication problems between the fpga and the host on the "read acquire region" method which is not executed. I managed to make it work randomly before, but not now. Maybe it is because of the reset that I added?
    If someone could check my code and help me, I would really appreciate it since nobody in my workplace has the expertise to do so :-) If you see some obvious mistake, please share with me, I also added some comment boxes in the code with questions.
    Delphine
    Attachments:
    thoughput.zip ‏1261 KB

  • DB_INIT_CB Segfaults on put with multiple threads

    Hi,
    I am working on a project that uses several bdb databases both btree, and hashmap inside an environment. This system is multithreaded and as such I decided to use the concurrent data storage subsystem to manage the threads. However this doesn't seem to to be working to well.
    When two threads call db->put on on the btree, bdb crashes. The stack trace is below:
    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 0x46e0a940 (LWP 24704)]
    0x00002aaaab492eb1 in __lock_get_internal () from /usr/local/BerkeleyDB.5.1/lib/libdb-5.1.so
    (gdb) ba
    #0 0x00002aaaab492eb1 in __lock_get_internal () from /usr/local/BerkeleyDB.5.1/lib/libdb-5.1.so
    #1 0x00002aaaab4937d2 in __lock_get () from /usr/local/BerkeleyDB.5.1/lib/libdb-5.1.so
    #2 0x00002aaaab4b53cf in __db_cursor () from /usr/local/BerkeleyDB.5.1/lib/libdb-5.1.so
    #3 0x00002aaaab4a4eb8 in __db_put () from /usr/local/BerkeleyDB.5.1/lib/libdb-5.1.so
    #4 0x00002aaaab4b81a9 in __db_put_pp () from /usr/local/BerkeleyDB.5.1/lib/libdb-5.1.so
    #5 0x00002aaaab787df8 in Db::put(DbTxn*, Dbt*, Dbt*, unsigned int) () from /usr/local/BerkeleyDB.5.1/lib/libdb_cxx-5.1.so
    #6 0x0000000000410da5 in BerkleyDbDataSlab::insertRecord (this=0x7261c0, rKey=0, value=0x46e0a050, size=<value optimized out>) at src/berkleydbbtree.cpp:69
    #7 0x000000000046a2a1 in ReadStoreManager::transferThread (this=0x6b0000, id=<value optimized out>) at src/rsmanager.cpp:55
    #8 0x00002aaaaaaca914 in thread_proxy () from /usr/lib/libboost_thread.so.1.46.1
    #9 0x00000035c560673d in start_thread () from /lib64/libpthread.so.0
    #10 0x0000003ed20d3d1d in clone () from /lib64/libc.so.6
    There are about 20 different databases in use here, and the setup is like so:
    Env Setup:
    u_int32_t env_flags = DB_CREATE | DB_INIT_CDB | DB_INIT_MPOOL;
    this->env = new DbEnv(0);
    env->set_cachesize(0, cacheSize, 1);
    u_int32_t m = 0;
    env->mutex_set_max(2000000);
    env->open(dir.c_str(), env_flags, 0);
    BTree database setup:
    db = new Db(env, 0);
    db->set_bt_compare(compare_double);
    db->set_flags(DB_DUPSORT);
    db->set_pagesize(pageSize);
    db->set_dup_compare(compare_double);
    u_int32_t oFlags = DB_CREATE;
    try {
    db->open(NULL, uuid.c_str(), NULL, DB_BTREE, oFlags, 0);
    This application is running on centos 5.5 with the latest version of bdb installed manually.
    Cheers
    Michael

    Hi Michael,
    820039 wrote:
    I am working on a project that uses several bdb databases both btree, and hashmap inside an environment. This system is multithreaded and as such I decided to use the concurrent data storage subsystem to manage the threads. However this doesn't seem to to be working to well.
    When two threads call db->put on on the btree, bdb crashes.The Berkeley DB Concurrent Data Store product adds multiple-reader, single writer capabilities to the Berkeley DB Data Store product. From what I understand you have two threads that are writing without any serialization. You either use the Berkeley DB Transactional Data Store, use just one thread to do the db->put operations or you do the serialization yourself, at the application level.
    Please let me know if it helps.
    Additional Documentation:
    The Berkeley DB products - http://download.oracle.com/docs/cd/E17076_01/html/programmer_reference/intro_products.html#id2707424
    Berkeley DB Concurrent Data Store Applications - http://download.oracle.com/docs/cd/E17076_01/html/programmer_reference/cam.html
    Berkeley DB Transactional Data Store Applications - http://download.oracle.com/docs/cd/E17076_01/html/programmer_reference/transapp.html
    Thanks,
    Bogdan

  • Reading text file with multiple variables

    When I open a text document containing 1 string of a Base64 Encoded Image, it works fine:
    import flash.display.Loader;
    import flash.utils.ByteArray;
    import formatter.Base64;
    var imgB64Str:String="";
    var ld:Loader=new Loader();
    var my_req:URLRequest = new URLRequest("horses.img");
    var my_loader:URLLoader = new URLLoader();
    my_loader.addEventListener(Event.COMPLETE, loadText);
    my_loader.load(my_req);
    function loadText(e:Event):void{
        // set string variable to loaded text
        imgB64Str = my_loader.data;
        // position, decode & display
        ld.x = ld.y = 50;
        ld.loadBytes(Base64.Decode(imgB64Str));
        addChild(ld);
    The image displays and that's great, but I need to display multiple images; therefore, I used the standard format: var1=value1&var2=value2&...
    (In reality, the values are the huge base64 strings.)
    Then I just needed to add "my_loader.dataFormat = URLLoaderDataFormat.VARIABLES;" since the format of my source changed.
    The thing that bugs me is that I'm tracing the imgB64Str after I set it and it traces fine (just like the other version). And from then on I'm not doing anything different!
    See my comments for things I did different...
    import flash.display.Loader;
    import flash.utils.ByteArray;
    import formatter.Base64;
    var imgB64Str:String="";
    var ld:Loader=new Loader();
    var my_req:URLRequest = new URLRequest("images.img"); // CHANGED: source file, due to new format
    var my_loader:URLLoader = new URLLoader();
    my_loader.dataFormat = URLLoaderDataFormat.VARIABLES; // CHANGED: formatting input from text to variables
    my_loader.addEventListener(Event.COMPLETE, loadText);
    my_loader.load(my_req);
    function loadText(e:Event):void{
        imgB64Str = my_loader.data.image1; // CHANGED: instead of grabbing whole data, grabbing the image1 variable
        trace(imgB64Str); // CHANGED: traces fine!
        // same as other from here down!
        ld.x = ld.y = 50;
        ld.loadBytes(Base64.Decode(imgB64Str));
        addChild(ld);
    It runs with no errors, but the image no longer displays.
    What's the deal?!? :/
    Any help is greatly appreciated.

    See this site: AN EASY REFERENCE FOR OLE AUTOMATION by Serder Simsekler.
    Best!
    Jim

Maybe you are looking for

  • Forced to use Airplay with Apple tv

    I just bought a new Retina MBP 15 inch, and since I got it with the educational discount promotion, I also got an Apple Store gift card. And with which I redeemed an Apple tv. At first having an Apple tv is an invaluable addition to making my whole h

  • How many iphones I can buy the contract price by using family plan?

    The apple.com only allows me to buy one iphone. if I choose a sprint family plan, can I buy more than one iphone by contract price? Can I buy them on apple.com or I need to go to a sprint retail?

  • Package is in hung state

    Hi, Suddenly package is not giving the output if we run manually , please can anyone suggest how i can troubleshoot this ? Thanks in advance PGR

  • How to update values to the database?

    hi all! iam using a simple form where some 4 or 5 textitems are used. with a select query, iam selecting a particular record. say, if i update a particular value(column), then how can i make the code in such a way that only particular column is updat

  • Why background color only works partially?

    Hi, I've tried to use "<d_iv class="myclass">" || #columnvalue#|| "</d_iv>" (it's div actually) in the query to make a specific column to be red at the background. Just like this: http://tinypic.com/view/?pic=rkx8c4 However, it seems the color only a