processes, threads, gtk development, portability on linux and win32

This is a discussion on processes, threads, gtk development, portability on linux and win32 within the C Programming forums, part of the General Programming Boards category; Hello, I will try to be as clear as possible. I am developing an application under linux using gtk. There ...

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    28

    processes, threads, gtk development, portability on linux and win32

    Hello,

    I will try to be as clear as possible. I am developing an application under linux using gtk. There are different gtk programs that can be run standalone. But I want another program to control their switch on/off, ie launch them and kill them at user's request.

    1. What would be the "best" way to do so? Using threads or processes?
    2. What would be the "best" way to proceed for portability between linux and win32. I read I could use fork and cygwin but I would like to "minimise the dependencies".

    Sorry, if there are any mistakes but I am kind of inexperienced in the multithreading programming.

    Cheers.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >1. What would be the "best" way to do so? Using threads or processes?
    Processes are definitely easier to get right than threads. If you were doing a straight Linux application then I would recommend processes.

    >2. What would be the "best" way to proceed for portability between linux and win32.
    Linux is inherently process-based while Windows is thread-based. If you want an application that can be more easily ported then you should use concepts that both systems support. In this case, threads. But don't hardcode the (probably pthread) functions and types, use opaque wrappers so that it's easier to replace the Linux specific code with Windows specific code. If you play your cards right, porting could be as easy as the conditional inclusion of a header.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WIN32 API and Linux... *shudder
    By parad0x13 in forum C++ Programming
    Replies: 4
    Last Post: 07-24-2008, 08:27 PM
  2. A question about windows programming
    By Hussain Hani in forum Windows Programming
    Replies: 16
    Last Post: 05-23-2007, 08:38 AM
  3. Linux equivalent to Win32 ShellExecute
    By BobS0327 in forum Linux Programming
    Replies: 4
    Last Post: 06-07-2006, 05:35 AM
  4. Difference between win32 and linux pthreads
    By philipsan in forum C Programming
    Replies: 1
    Last Post: 02-07-2006, 04:57 PM
  5. compiling win32 apps under linux?
    By talz13 in forum Linux Programming
    Replies: 11
    Last Post: 02-07-2005, 12:43 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21