How to implement a FIFO buffer

Hi
I need to implement a FIFO buffer. One thread puts objects into it, another thread gets them (both threads are within the same application).
What is the common way to implement such e buffer?
Of course, I don't need any details - the names of the right classes or interfaces would be great.

http://java.sun.com/javase/6/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html

Similar Messages

  • Implementing a circular buffer - which approach works best?

    I'm just implementing a circular buffer (or a circular queue, to be precise). Now I wonder which is better for wrapping around when inserting:
    Using the modulo operator or using some variable to store the insertionPoint and incrementing it after each insert?
    Does it make any difference in performance / readability?
    Greets, Oliver

    Trollhorn wrote:
    Uh, that article is really nice... thanks...Is that sarcasm, or is it "prob sol"?
    My suggestion would simply be: Why roll your own, when you can just use a standard implementation provided by the JDK (you do know about the java.util.Queue interface and can find standard classes which implement it, right?).
    So is this just for an academic exercise, or are you one of those premature optimizer kinda guys feeling the need to eek out every last millisecond of processing and/or save every last byte of memory? And maybe you fear the reaper (garbage collector) too.
    I don't see a real need for a "circular queue". Circular buffers, circular lists yes (where you iterate over it in a circular fashion), but when I think of a queue I think of FIFO pushing and popping elements, not iterating over it.

  • FIFO buffer control in Windows 7 Home Premium

    Hi all.
    I'm trying to communicate with a CNC mill through a serial port (RS232). I used to run Windows XP but am now running Windows 7 Home Premium. In XP there was an option in Device Manager on the port(COM) under properties where I could set the FIFO buffering
    to low, but I can not find this option in Windows 7 Home Premium. I have heard the option does exist in Windows 7 Pro.
    Does anyone know how to make this setting in Home Premium?
    Regards,
    Lene

    Hi Lene,
    I can change the COM FIFO buffer in Windows 7 Enterprise in Device Manager.
    We may take a try to use the registry key to change the Receive and Transmit Buffer level.
    Please take following steps to change the Buffer.
    1. Open Registry Editor.
    2. Go to HKLM\SYSTEM\CurrentControlSet\Services\Serial
    3. Change the RxFIFO and TxFIFO values, they represent the Receive buffer and transmit buffer.
    For more information,  please refer to the following article.
    http://technet.microsoft.com/en-us/library/cc962421.aspx
    Before making any changes in registry, please make backup first.
    Hope it will be helpful.
    Best regards,
    Fangzhou CHEN
    Fangzhou CHEN
    TechNet Community Support

  • How to capture audio into buffer

    i currently doing a voip apllication using SIP as the protocol
    since the j2me now doesnt only have the jsr 180
    its not enough to support voip call
    wat i wan to do is capture d audio then put in buffer then send out through d socket to another client and its automatically plays it
    can this work?
    its seen like converting the text conversation into voice conversation
    but sadly i dont know how to implement the real-time voice conversation
    can anyone help me?

    Hi,
    you have to deal with OCCI Metadata. To start look here
    http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14294/metadata.htm#BABFEDDJ
    Regards,
    Michael

  • How to Implement BW in IT Service Desk/IT Help Desk /IT Complain Surveillance Dept/IT Customer Support Dept?

    Hi
    If a organization have 200 to 300 daily complains of there IT equipment/Software/Network e.t.c.
    How to Implement BW in IT Service Desk/IT Help Desk /IT Complain Surveillance Dept/IT Customer Support Dept?
    Is there any standard DataSources/InfoObjects/DSOs/InfoCubes etc. available in SAP BI Content?

    Imran,
    The point I think was to ensure that you knew exactly what was required. A customer service desk can have many interpretations from a BI perspective.
    You could have :
    1. Operational reports - calls attended per shift , Average number of calls per person , Seasonality in the calls coming in etc
    2. Analytic views - Utilization of resources , Average call time and trending , customer satisfaction , average wait time
    3. Strategic - Call volumes corresponding to campaigns etc , Employee churn and related call times
    Based on these you would then have to construct your models which would be populated by data from the MySQL instance for you to report.
    Else if you have BWA you could have data discovery instead or if you have HANA - you could do even more and if you have a HANA sidecar - you technically dont need BW. The possibilities are virtually endless - it depends on how you want to drive it and how the end user ( client ) sees value in the same.

  • How to implement implicit and explicit enhancement points

    Hi,
    Can anybody please provide some technical aspects of enhancement spots. I have gone through several sap sites and help poratl but have not get much technical things (how to implement or related t codes). please do not provide link to read theories.
    Rgds
    sudhanshu

    Hi,
    Refer to this link...
    http://help.sap.com/saphelp_nw2004s/helpdata/en/5f/103a4280da9923e10000000a155106/content.htm

  • How many types of authentications in sharepoint and how to implement those authentication in sharepoint?

    Hi All,
    How many types of authentications in sharepoint and how to implement those authentication in sharepoint?
    can any one explain the above things with examples?
    Thanks in Advance!

    In addition to
    A Sai Gunaranjan you can also check this URL for Sharepoint 2010:
    http://technet.microsoft.com/en-us/library/cc288475(v=office.14).aspx
    http://www.codeproject.com/Tips/382312/SharePoint-2010-Form-Based-Authentication
    ***If my post is answer for your query please mark as answer***
    ***If my answer is helpful please vote***

  • How to Implement custom share functionality in SharePoint 2013 document Lib programmatically?

    Hi,
    I have created custom action for Share functionality in document library.
    On Share action i'm showing Model pop up with Share form with addition functionality.
    I am developing custom share functionality because there is some addition functionality related to this.
    How to Implement custom share functionality in SharePoint 2013  document Lib pro-grammatically?
    Regards,
    - Siddhehswar

    Hi Siddhehswar:
    I would suggest that you use the
    Ribbon. Because this is a flexible way for SharePoint. In my project experience, I always suggest my customers to use it. In the feature, if my customers have customization about permission then i can accomplish this as soon
    as possible. Simple put, I utilize this perfect mechanism to resolve our complex project requirement. Maybe we customize Upload/ Edit/ Modify/ Barcode/ Send mail etc... For example:
    We customize <Edit> Ribbon. As shown below.
    When user click <Edit Item>, the system will
    render customized pop up window.
    Will

  • Can't Figure Out How To Implement IEnumerable T

    I have no problem implementing IEnumerable but can't figure out how to implement IEnumerable<T>. Using the non-generic ArrayList, I have this code:
    class PeopleCollection : IEnumerable
    ArrayList people = new ArrayList();
    public PeopleCollection() { }
    public IEnumerator GetEnumerator()
    return people.GetEnumerator();
    class Program
    static void Main(string[] args)
    PeopleCollection collection = new PeopleCollection();
    foreach (Person p in collection)
    Console.WriteLine(p);
    I'm trying to do the same thing (using a List<Person> as the member variable instead of ArrayList) but get compile errors involving improper return types on my GetEnumerator() method. I start out with this:
    class PeopleCollection : IEnumerable<Person>
    List<Person> myPeople = new List<Person>();
    public PeopleCollection() { }
    public IEnumerator<Person> GetEnumerator()
    throw new NotImplementedException();
    IEnumerator IEnumerable.GetEnumerator()
    throw new NotImplementedException();
    class Program
    static void Main(string[] args)
    // Create a PeopleCollection object.
    PeopleCollection peopleCollection = new PeopleCollection();
    // Iterate over the collection.
    foreach (Person p in peopleCollection)
    Console.WriteLine(p);
    Console.ReadLine();
    That code compiles (basically because I haven't really done anything yet), but I get compile errors when I try to implement the GetEnumerator() methods.

    The List<T> class implements the IEnumerable<T> interface, so your enumerator can return the GetEnumerator call from the list.
    class PeopleCollection : IEnumerable<Person>
    List<Person> myPeople = new List<Person>();
    public PeopleCollection() { }
    public IEnumerator<Person> GetEnumerator()
    return myPeople.GetEnumerator();
    IEnumerator IEnumerable.GetEnumerator()
    return myPeople.GetEnumerator();
    class Program
    static void Main(string[] args)
    // Create a PeopleCollection object.
    PeopleCollection peopleCollection = new PeopleCollection();
    // Iterate over the collection.
    foreach (Person p in peopleCollection)
    Console.WriteLine(p);
    Console.ReadLine();

  • How to implement Tool TIP in Table Control

    Hello Everyone,
    Can you please tell me how to implement a tooltip messages in table control columns.
    The Tooltip contains a simple message like "Doublde click on column.
    Thanks in advance.
    Edited by: Suruchi Razdan on Jun 6, 2011 7:57 AM

    Hello,
    In table Control->first Header Row has chance to maintain the Tooltip option.
    In table control columns maintain Double click options in attributes .
    Regards,
    Praveen

  • How to implement a java class in my form .

    Hi All ,
    I'm trying to create a Button or a Bean Area Item and Implement a class to it on the ( IMPLEMENTATION CLASS ) property such as ( oracle.forms.demos.RoundedButton ) class . but it doesn't work ... please tell me how to implement such a class to my button .
    Thanx a lot for your help.
    AIN
    null

    hi [email protected]
    tell me my friend .. how can i extend
    the standard Forms button in Java ? ... what is the tool for that ... can you explain more please .. or can you give me a full example ... i don't have any expereience on that .. i'm waiting for your reply .
    Thanx a lot for your cooperation .
    Ali
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected]:
    Henrik, the Java importer lets you call Java classes on the app server side - I think what Ali is trying to do is integrate on the client side.
    If you want to add your own button then if you extend the standard Forms button in Java and then use this class name in the implementation class property then the Java for your button will be used instead of the standard Forms button. And since it has extended the basic Forms button it has all the standard button functionality.
    There is a white paper on OTN about this and we have created a new white paper which will be out in a couple of months (I think).
    Regards
    Grant Ronald<HR></BLOCKQUOTE>
    null

  • How to implement a file system in my app?

    How to implement a file system in my app? So that we can connect to my iPhone via Finder->Go->Connect to Server. And my iPhone will show as a shared disk. Any ideas about it? Thanks.

    Hi Rain--
    From webdav.org:
    DAV-E is a WebDAV client for iPhone, with free and full versions. It provides remote file browsing via WebDAV, and can be used to upload pictures taken with the iPhone.
    http://greenbytes.de/dav-e.html
    http://www.greenbytes.de/tech/webdav/
    Hope this helps.

  • How to implement remote blob storage in SharePoint 2013

    How to implement remote blob storage in SharePoint 2013 

    Try below:
    http://blogs.technet.com/b/wbaer/archive/2013/05/23/deploying-remote-blob-storage-with-sql-server-2012-alwayson-availability-groups.aspx
    If this helped you resolve your issue, please mark it Answered. You can reach me through http://itfreesupport.com/

  • How to implement tool-tip for the list items for the Choice column in SharePoint 2013

    I had created a simple list with a "Choice" column, i have three entries in my drop-down, 
    First Entry
    Second Entry
    Third Entry.
    If i select any entries in drop-down and hour-over (Second Entry), a
    tool-tip need need to show. 
    Is it possible? If yes how to implement any help will be appreciated.

    Hi,
    We can use JavaScript to achieve it.
    The following code for your reference:
    <script type="text/javascript" src="/sites/DennisSite/Shared%20Documents/js/wz_tooltip.js"></script>
    <script type="text/javascript" src="/sites/DennisSite/Shared%20Documents/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript">
    $(function () {
    $("select[title='Choice']").change(function(){
    Tip($(this).val());
    $("select[title='Choice']").mouseout(function(){
    UnTip();
    </script>
    Download wz_tooltip.js:
    http://www.walterzorn.de/en/tooltip/tooltip_e.htm#download
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How to implement tooltip for the list items for the particular column in sharepoint 2013

    Hi,
    I had created a list, How to implement tooltip for the list items for the particular column in SharePoint 2013.
    Any help will be appreciated

    We can use JavaScript or JQuery to show the tooltips. Refer to the following similar thread.
    http://social.technet.microsoft.com/forums/en/sharepointdevelopmentprevious/thread/1dac3ae0-c9ce-419d-b6dd-08dd48284324
    http://stackoverflow.com/questions/3366515/small-description-window-on-mouse-hover-on-hyperlink
    http://spjsblog.com/2012/02/12/list-view-preview-item-on-hover-sharepoint-2010/

Maybe you are looking for

  • Cannot turn autonegotiation off in atheros ar8151 ethernet card

    My isp requires me to turn autonegotiation off and use 10mbps full duplex as connection type, I do that for my laptop using ethtool #ethtool -s eth0 autoneg off speed 10 duplex full And i can successfully use the internet but, my desktop has a athero

  • Rror: The listener returned the following Message: 503 Service Unavailable

    I have this PL/SQL item type based on a store proc... the stored proc returns the correct result but when I add this stored proc to the page the rest of the html portlets get the following errors on the header and body content what can be the reason.

  • How to do Toggling between records?

    Users are able to pull multiple preview records from the campaign. When they pull the records they are unable to go back to the record which they wanted. This feature will also be helpful when an inbound call comes in when user is working on a previe

  • Radiobuttons with jsf

    Hello, Can someone tell me hints about with jsf and radiobuttons. I have data about cats in my backing bean (The data can be in a list implementation for example). I want to use radiobutton to select one of 4 cats and send that user selection and add

  • Working web gallery file locations?

    LR3's ftp is timing out so I need to upload the gallery files with an ftp client. However, I can't find where it's putting the files to be uploaded. Where does it put them in windows 7?