by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Francisco Sant'Anna
    @fsantanna
    Because one can inline code there. If Trail1 and Trail2 are just called once, you don't need them and you may put their code directly there.
    Some trails are just one liners as well:
    par/or do
        await 1s;
    with
        await Trail2();
    end
    Some time you want to mix all of them together:
    par/or do
        await 1s;
    with
        await Trail1();
        await 500ms;
        await Trail2();
    end
    It's more flexible.
    Daniel Austin
    @fluffynukeit
    Thanks. I'll need to digest this a little more to really grok the advantages. At first glance, it's not obvious to me why those couldn't be accomplished via the fake syntax: await 1s or Trail2(), for example. However, I do think your second example would be more verbose if it had to be done with a
    var a = spawn do 
        await Trail1();
        <etc>
    end
    await 1s or a;
    Francisco Sant'Anna
    @fsantanna
    Ok, change 1-liners to 2-liners. You will need to give names to things that could be anonymous. Even for the await 1s or a, you loose the symmetry between the two.
    Daniel Austin
    @fluffynukeit

    You will need to give names to things that could be anonymous.

    Indeed, good point. Thanks

    tyrbentsen
    @tyrbentsen
    Thank you for the replies.
    After a quick read of the paper you mentioned: https://link.springer.com/chapter/10.1007%2F3-540-57529-4_44, I was wondering if abortion of asynchronous code is possible in Céu (e.g. await async/thread) or is it only possible for synchronous code?
    Francisco Sant'Anna
    @fsantanna

    I was wondering if abortion of asynchronous code is possible in Céu (e.g. await async/thread) or is it only possible for synchronous code?

    Yes, it is possible and supported.

    Asynchronous threads exist in Céu for two reasons:

    • To perform time-consuming computations
    • To interact with blocking I/O libraries
      Threads have independent scheduling and must live in a global structure in the heap (currently a linked list).
      When they need to share memory with the synchronous side , they must use an atomic block for mutual exclusion (e.g., to communicate the result of a computation or blocking input).
      Since they have independent scheduling, they cannot be aborted with perfect synchronization with the synchronous side.
      So, when a par/or wants to abort a nested thread, these are the possibilities:1. The thread is inside an atomic block. This is actually not a possibility since the synchronous side could not be executing (mutual exclusion).2. The thread is computing a value.3. The thread is blocked.
      The two last options are harmless for the synchronous side.So, when a par/or wants to abort a thread it does two things:- It calls an ABORT wrapper that, if supported by the underlying API (e.g. pthread_cancel), signals the thread that it should terminate. If not supported, the thread will just waste CPU cycles.
    • It sets an aborted flag in the global structure. In the generated code, when a thread tries to enter an atomic block, it first checks this flag to possibly terminate directly.
    tyrbentsen
    @tyrbentsen
    Thank you for the clarification!
    What happens if the async thread does IO after the par/or block has been aborted but before the thread has been terminated?
    So after the par/or block finishes but before the async thread reaches such an atomic block like you described or a pthread_cancel cancellation point.
    tyrbentsen
    @tyrbentsen
    E.g. a par/or block with one trail that awaits a button press, and another trail that writes a bunch of lines to a file (and checks every 10 lines for cancellation). What happens when the button is pressed, but before the 10th line is reached?
    Francisco Sant'Anna
    @fsantanna
    The I/O will occur. If it's a printf the user will see its message on the screen.
    I forgot to discuss problems related to leaks, but I believe it's already clear...
    In this same example, the thread will not reach fclose at its end, so it should resort to pthread's clean up mechanisms.
    Of course, the whole idea of Céu is to do I/O in the synchronous side. I/O in threads should be a "temporary hack" before finding/porting an appropriate asynchronous alternative (e.g., libuv).
    tyrbentsen
    @tyrbentsen
    That makes perfect sense!
    Thank you
    tyrbentsen
    @tyrbentsen
    Hi, I have another question. Why is it needed to emit external output events
    Why not doing the output directly?
    Francisco Sant'Anna
    @fsantanna
    • For symmetry with input, Céu is designed to model I/O so it's expected to provide both as special.
    • To aid static analysis. It is easy to track external side effects.
    • To link output and input events between different processes transparently, potentially in different machines. (See https://www.maxwell.vrac.puc-rio.br/37372/37372.PDF)
    If possible, I suggest to move this kind of discussion to the mailing list of Céu: https://groups.google.com/forum/#!forum/ceu-lang
    (Let's use the chat for more real-time interactions on installing/operating the language, etc.)
    tyrbentsen
    @tyrbentsen
    Thank you!
    Dinesh Bhagat
    @rapperdinesh
    Hi ! I am Dinesh Bhagat , a sophomore at IIT Mandi, India. I am interested in contributing in ceu language. Can anyone please guide me in the same ?
    Dinesh Bhagat
    @rapperdinesh
    While installing Ceu I am facinf difficulty in the below step. """sudo make install # install as "/usr/local/bin/ceu""". Please help !
    Francisco Sant'Anna
    @fsantanna
    Hi @rapperdinesh , what error do you get when you try it?
    Dinesh Bhagat
    @rapperdinesh
    @fsantanna It shows this message """install ./src/lua/ceu /usr/local/bin/ceu"""
    Francisco Sant'Anna
    @fsantanna
    Did you try to run the tests?
    Dinesh Bhagat
    @rapperdinesh
    on running test it shows this error --> https://pasteboard.co/IGOnulR.png
    and on make samples it shows --> make: * No rule to make target 'samples'. Stop.
    Francisco Sant'Anna
    @fsantanna
    In which directory are you running make samples?
    Dinesh Bhagat
    @rapperdinesh
    Thanks @fsantanna .... Got it, Solved the issue ! Thanks for the help ! Looking forward to contribute in the code base !
    Dinesh Bhagat
    @rapperdinesh
    Hey @fsantanna I went over Lua and Ceu in last weeks . And I want to ask if I can take up some work of designing an IDE for Ceu ? There is an already an exisiting on Lua named 'ZeroBrane'.
    Your suggestions will be valuable
    Francisco Sant'Anna
    @fsantanna
    Hi @rapperdinesh , of course you can. We are open to contributions! I'll be on vacations during the next two weeks but I can help with whatever you need.
    Priyanshu Singh
    @priyanshux
    Hey, can someone help me find the LabLua's Gitter channel. I wish to contribute to the organisation
    Francisco Sant'Anna
    @fsantanna

    Hey, can someone help me find the LabLua's Gitter channel. I wish to contribute to the organisation

    There's a mailing list: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/labluagsoc/-28pkHQp2xE/o-f2t6nxAQAJ

    vibudhvishal
    @vibudhvishal
    hi @fsantanna I m did the installation of ceu in my system and i m using kali Linux , the installation was successful but will using kali pose a problem in future
    Francisco Sant'Anna
    @fsantanna

    hi @fsantanna I m did the installation of ceu in my system and i m using kali Linux , the installation was successful but will using kali pose a problem in future

    it's ok

    robert-lachapelle
    @robert-lachapelle
    @fsantanna I have a quick question about using the event in from c++ code. I am trying to send ceu_sys_go( &app, CEU_IN_LEVEL_SMASH_EXPANDED_DONE, &resp ); but with this my resp is an array of int's what is the best way to handle this.
    what is the proper format to apply the resp too: tceu__int?
    robert-lachapelle
    @robert-lachapelle
    I am trying for this where I just did:
    int resp[32] = value;
    ceu_sys_go( &app, CEU_IN_LEVEL_SMASH_EXPANDED_DONE, &resp );
    robert-lachapelle
    @robert-lachapelle
    This is what is defined on the ceu side input int[32] GET_SEAL_CHECK_DONE;
    robert-lachapelle
    @robert-lachapelle
    I just realized I typed different events but in my code they are the same just a typo above.
    robert-lachapelle
    @robert-lachapelle
    @fsantanna I am from IDEXX labs and we have been using CEU to do some instrument control and I was hoping to get some input on passing arrays into and out of ceu.
    robert-lachapelle
    @robert-lachapelle
    I just wanted to make sure it is Ok how did this final solution

    c++ Side

    int resp_data[32] = { };
    std::vector<int32_t> data_int  = pEvt->GetParameterAsIntVector();
    data_int.resize( countof( resp_data ) );
    std::copy( data_int.begin(), data_int.end(), resp_data );
    ceu_sys_go( &app, CEU_IN_GET_SEAL_CHECK_DONE, &resp_data );

    Ceu Side

    define GETSEALCHECK( context ) \

    do \
    _get( _AMS, _PRM_PRESSURE_TRACE_CONDENSED_BUFFER ); \
    var int *retval = await GET_SEAL_CHECK_DONE; \
    _log_seal_check_data( context, retval ); \
    end

    Francisco Sant'Anna
    @fsantanna
    @robert-lachapelle Hi! Can you please contact me by e-mail in this specific case? francisco.santanna@gmail.com