How to implement a

I have an application which uses the Comm API to communicate to a device
through the serial port. It is now necessary that I get acknowledgements
back from the device between messages. That is, I send a packet, and
cannot send another packet until that one is acknowledged. So, I need to
create a queue of packets to send, and after each is sent, I need to listen for
incoming packets to determine if I got an acknowledgement, after which I
can send the next one.
Other unrelated packets might come in, so I cannot "busy wait".
It seems like the best choice is to have a queue that is on its own thread, so
that whenever a packet comes in both the main thread and the queue
thread can decide how to react to it. I have some ideas about how to
implement this, but they are probably not "clean".
Is there a class that does something like this? I was going to create a class
which implements Runnable, and listens to the class which deals with the
serial port, and have the run method send a packet, and wait until a flag
was set that verifies that the acknowledgement packet was recieved, and
then it would send the next one. But I am a bit confused about what
happens when the queue gets empty and the run method stops.
So then I thought the queue would belong to a different class which would
create a new thread if the queue is empty, and keep adding to it as long as
it is empty. That is, if the queue is empty, create a new thread and start it.
If the queue is not empty, just add the new object to the currently running thread.
Does any of this make sense? Ideas?
Thanks,
Chuck.

I'm not at all sure what the "future result" pattern is, and a google search
didn't help much.
Wouldnt you check for a message before trying to send
something?
Vector queue;
if(queue.size() > 0 ) {
// transmit
I think you are missing something here--If the queue is empty, what happens? What is listening for new requests to send? What is waiting
for acknowledgments?
However, I think I can solve the problem without threads simply by having the queue listen for incoming packets, and if an acknowledgement is received, then the next packet is sent. Otherwise, it resends the original. The only downside I see to this is that if packets are never received, they are never sent. But if that is the case, there are bigger problems to deal with, so I think it may be acceptable.

Similar Messages

  • 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/

  • How to implement reading data from a mat file on a cRIO?

    Hi all!
    I am not even sure, this is plausible, but I'd rather ask before i start complicating. So far, I have not found any helpful info about reading in data to a RT device from a file (kind of a simulation test - the data is simulated). 
    I have the MatLab plugin that allows the data storage read a MAT file, which has a number of colums representing different signals and lines representing the samples at a given time (based on the sample time - each sample time has it's own line of signal data). 
    I have no idea of how to implement this to cRIO.
    The idea is:
    I have some algorithms that run on the RIO controller in a timed loop. As the inputs to these algorithms, i would need to acces each of the columns values in the line, that corresponds to the sample time (kind of a time series - without the actual times written).
    I am fairly new to RT and LV development, so any help would be much appreciated.
    Thanks, 
    Luka
    Solved!
    Go to Solution.

    Hi Luka!
    MAT file support in LabVIEW is handled by DataPlugins. Here you can find the MATLAb plugin:
    http://zone.ni.com/devzone/cda/epd/p/id/4178
    And here you can find information on how to use DataPlugins to read or write files of a certain format:
    http://www.ni.com/white-paper/11951/en
    There is also an open-source project that addresses the problem, you can find it at
    http://matio-labview.sourceforge.net/
    Unfortunately, RT systems are not supported by DataPlugins, so fist you'll have to write a VI on the Host computer to convert your files to a usable format (I suggest TMDS for compactness and ease of use), and the work on the converted files in the cRIO VI. If you have other questions about DataPlugins or anything else, please get back to me.
    Best regards:
    Andrew Valko
    National Instruments
    Andrew Valko
    National Instruments Hungary

  • How to implement multiple Value Helps within the same Application ??

    Dear Experts,
    I want to implement multiple value helps in the same view.For that I have declared exporting parameters of type 'wdy_key_value_table.' within the component controller for each of the value helps.While I do activate and test the application I get the following error :
    The following error text was processed in the system HE6 : A row with the same key already exists.
    The error occurred on the application server hsdnt24s11_HE6_00 and in the work process 4 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: VALUESET_BSART of program /1BCWDY/9VSHJWRNR0EZPKFT3ZKC==CP
    Method: IF_PO_VIEW1~VALUESET_BSART of program /1BCWDY/9VSHJWRNR0EZPKFT3ZKC==CP
    Method: WDDOINIT of program /1BCWDY/9VSHJWRNR0EZPKFT3ZKC==CP
    Method: IF_WDR_VIEW_DELEGATE~WD_DO_INIT of program /1BCWDY/9VSHJWRNR0EZPKFT3ZKC==CP
    Method: DO_INIT of program CL_WDR_DELEGATING_VIEW========CP
    Method: INIT_CONTROLLER of program CL_WDR_CONTROLLER=============CP
    Method: INIT_CONTROLLER of program CL_WDR_VIEW===================CP
    Method: INIT of program CL_WDR_CONTROLLER=============CP
    Method: GET_VIEW of program CL_WDR_VIEW_MANAGER===========CP
    Method: BIND_ROOT of program CL_WDR_VIEW_MANAGER===========CP
    I dont know how to implement multiple value helps.Need your help on this.
    Regards,
    Mamai.

    Hi
    Hint is : A row with the same key already exists it means , It is assigning the same value/Key to row and you are calling it at WDDOINIT  so it giving error at the time of initialization .
    Better way to do the coding at some event in view OR if not possible than just execute the first value help in wddoinit later clear all the value before gettig the other Value help. Code it at WdDoModify View to get its run time behaviour.
    BR
    Satish Kumar

  • How to implement table in applet

    hi friends
    i have no idea ,how to implement tables in awt for applet can u suggest way to solve my problem.im using jcreator to implement my project.

    Crosspost: http://forum.java.sun.com/thread.jspa?threadID=783376
    You already got plenty of answers. Why do you ask again? Didn't you like the answers?

  • How to implement this calendar function in ABAP code

    Hi everyone,
    Our requirement is : Give a date (e.g. YYYY.MM.DD, 1983.12.26), then we need to know which weekday it is. Is there a existing FM for this fuction? or how to implement it in ABAP?
    Thanks a lot for any hint
    Best regards
    Deyang

    Hi Deyang Liu,
        Could you please check these the below links they would give you some idea ....[SAP Calendar Control|http://help.sap.com/printdocu/core/print46b/en/data/en/pdf/BCCICALENDAR/SAP_KALENDER.pdf]
    [Calendar functions |http://help.sap.com/saphelp_nw04/Helpdata/EN/2a/fa00f6493111d182b70000e829fbfe/content.htm]
    [SAP Functions|http://abap4.tripod.com/SAP_Functions.html]
    [Determine calendar |http://help.sap.com/saphelp_nw04/helpdata/en/2a/fa00e9493111d182b70000e829fbfe/content.htm]
    Regards,
    S.Manu

Maybe you are looking for

  • RRI Issue when jumping to TCode in R/3

    Hi Experts, I need to Jump through RRI (RSBBS) from BW summary query to BW detailed query and from BW detailed query to TCode WB23 in our requirement. So i have created two RRI's in BW dev system one from Summary to detailed report and other from Det

  • How do I get my entire site to come up when someone clicks search results of just one page of my sit

    When someone searches for my site in google, sometimes only one page of  my site comes up. If they click it, they may only get my menubar, or a  page, such as my calendar page without a menubar or topbar. How can I  make it so when they click the lin

  • How to delete a path item from within a group item?

    I am generating and downloading QR codes in vector format (.eps).  I use VB scripting to place each QR code into an Illustrator document for later laser etching as a batch.  Each QR code is comprised of a bunch of small, individual filled squares all

  • I have been having multiple issues lately with my iMac

    I have been having multiple issues lately with my iMac - starting with insanely slow processing/run speeds.  When I run Activity Monitor, consistently the highest usage of CPU is "ReportCrash" - typically shows up as 80-200% of CPU. What could this b

  • Portal 7 & Fedora Core 5

    Hi, has anybody experience with installing portal server 7 on fedora core 5? I know it's not supported, but is it possible to install it somehow? thanks