The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
using SDL threads and openMP, is it safe?
Leonardo Da Vinci Feli...
Guest

    Mainly, my question is in the title of the email ^^. But let me tell me motivation:
    I'm doing something that really needs a powerful processing in order to perform a critical time system. So, threads are really needed. I have to be honest: I'm now on treading, but I have the theoretical knowledge ^^".    To achieve that, I need to do some synchronization between threads (like barrier, that I do not now how to implement only with SDL threads). Pthread is not a good choice, once I need it to be as portable as possible. So, openmp was in my mind, also, it's easier to use.
    Then the question is: is there any problem if I mix both threads, SDL and openMP? And if I use only OpenMP threads,without creating a single thread by SDL, and use others SDL function (like SDL_RenderPresent), is there a problem?

PS.: haven't found that googling

--
Atenciosamente, Leonardo Da Vinci
using SDL threads and openMP, is it safe?
alabouza


Joined: 08 Dec 2009
Posts: 48
Location: Sao Paulo , Brasil
Hi Leonardo.

I continuously use OpenMP in SDL based project.  Events and graphics with SLD 2.0x and threads with OpenMP. Specifically using 99% of OpenMP and very rarely a call to SDL threads. I do not mix both threads resource.

As additional information, all projects compiled with Intel C and running under Windows.

Regards.

Armando


On Fri, Jun 17, 2016 at 3:20 PM, Leonardo Da Vinci Feliciano Sebastião wrote:
Quote:
    Mainly, my question is in the title of the email ^^. But let me tell me motivation:
    I'm doing something that really needs a powerful processing in order to perform a critical time system. So, threads are really needed. I have to be honest: I'm now on treading, but I have the theoretical knowledge ^^".    To achieve that, I need to do some synchronization between threads (like barrier, that I do not now how to implement only with SDL threads). Pthread is not a good choice, once I need it to be as portable as possible. So, openmp was in my mind, also, it's easier to use.
    Then the question is: is there any problem if I mix both threads, SDL and openMP? And if I use only OpenMP threads,without creating a single thread by SDL, and use others SDL function (like SDL_RenderPresent), is there a problem?

PS.: haven't found that googling

--
Atenciosamente, Leonardo Da Vinci





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

using SDL threads and openMP, is it safe?
Leonardo Da Vinci Feli...
Guest

Great, that's just what a needed.Thank you very much =)


2016-06-17 15:46 GMT-03:00 Armando Alaminos Bouza:
Quote:
Hi Leonardo.

I continuously use OpenMP in SDL based project.  Events and graphics with SLD 2.0x and threads with OpenMP. Specifically using 99% of OpenMP and very rarely a call to SDL threads. I do not mix both threads resource.

As additional information, all projects compiled with Intel C and running under Windows.

Regards.

Armando


On Fri, Jun 17, 2016 at 3:20 PM, Leonardo Da Vinci Feliciano Sebastião wrote:


Quote:
    Mainly, my question is in the title of the email ^^. But let me tell me motivation:
    I'm doing something that really needs a powerful processing in order to perform a critical time system. So, threads are really needed. I have to be honest: I'm now on treading, but I have the theoretical knowledge ^^".    To achieve that, I need to do some synchronization between threads (like barrier, that I do not now how to implement only with SDL threads). Pthread is not a good choice, once I need it to be as portable as possible. So, openmp was in my mind, also, it's easier to use.
    Then the question is: is there any problem if I mix both threads, SDL and openMP? And if I use only OpenMP threads,without creating a single thread by SDL, and use others SDL function (like SDL_RenderPresent), is there a problem?

PS.: haven't found that googling

--
Atenciosamente, Leonardo Da Vinci







_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





--
Atenciosamente, Leonardo Da Vinci