Ignore:
Timestamp:
01/24/17 16:15:50 (4 years ago)
Author:
rlacroix
Message:

Make the XIOS server(s) completely non-blocking.

This fixes some deadlocks caused by bugs in the communication protocol when using inputs and multiple contexts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/context_client.hpp

    r988 r1033  
    3131      // Send event to server 
    3232      void sendEvent(CEventClient& event); 
     33      bool sendTemporarilyBufferedEvent(); 
    3334      void waitEvent(list<int>& ranks); 
    3435 
    35       // Functions relates to set/get buffers 
    36       list<CBufferOut*> getBuffers(list<int>& serverlist, list<int>& sizeList); 
     36      // Functions to set/get buffers 
     37      bool getBuffers(const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, bool nonBlocking = false); 
    3738      void newBuffer(int rank); 
    3839      bool checkBuffers(list<int>& ranks); 
     
    4647 
    4748      bool isAttachedModeEnabled() const; 
     49 
     50      bool hasTemporarilyBufferedEvent() const { return !tmpBufferedEvent.isEmpty(); }; 
    4851 
    4952      // Close and finalize context client 
     
    7679      StdSize maxBufferedEvents; 
    7780 
     81      struct { 
     82        std::list<int> ranks, sizes; 
     83        std::list<CBufferOut*> buffers; 
     84 
     85        bool isEmpty() const { return ranks.empty(); }; 
     86        void clear() { 
     87          ranks.clear(); 
     88          sizes.clear(); 
     89 
     90          for (std::list<CBufferOut*>::iterator it = buffers.begin(); it != buffers.end(); it++) 
     91            delete *it; 
     92 
     93          buffers.clear(); 
     94        }; 
     95      } tmpBufferedEvent; //! Event temporarily buffered (used only on the server) 
     96 
    7897      //! Context for server (Only used in attached mode) 
    7998      CContext* parentServer; 
Note: See TracChangeset for help on using the changeset viewer.