Project

General

Profile

[Invalid] Why do you use gthread instead of pthread?

Added by nicolas.sitbon over 15 years ago

Hi everybody, I think all is in the title.
Thanks.


Replies (14)

RE: Why do you use gthread instead of pthread? - Added by jan over 15 years ago

gthread is a thin wrapper around pthread if you are on a pthread system and a bit more complex, if you aren't (like on win32). We need some wrapper for it anyway if we want to be platform independent and gthread provides us one.

Jan

RE: Why do you use gthread instead of pthread? - Added by darix over 15 years ago

every system with glib2?

RE: Why do you use gthread instead of pthread? - Added by nicolas.sitbon over 15 years ago

Well my question is which system are supported by lighttpd?

RE: Why do you use gthread instead of pthread? - Added by nicolas.sitbon over 15 years ago

Which systems are supported by lighttpd where pthreads are not present (natively or via library)?

RE: Why do you use gthread instead of pthread? - Added by nicolas.sitbon over 15 years ago

I don't think glib is a "thin" wrapper, rather a huge wrapper, bigger than lighttpd itself, I think it's a bad choice for a "light" server, I'm currently working on Linux, Solaris and Windows and there is a good implementation of pthread on them, I use lighttpd 1.4.20 but if lighttpd starts using bad libraries or will have big dependencies, I won't upgrade to 1.5 and will come back to apache or will be forced to fork. Too bad, you reproduce apache errors.

RE: Why do you use gthread instead of pthread? - Added by stbuehler over 15 years ago

Please stop whining about glib... either accept it or go away. Or provide proof that glib is bad; and not just "it is big and bad and stupid".
But i guess even then we will continue using glib in lighttpd-sandbox.

In 1.5 gthread/glib will probably stay optional (of course you will need it for the gthread-backends).

RE: Why do you use gthread instead of pthread? - Added by darix over 15 years ago

thanks for a rather useless comment nicolas.

RE: Why do you use gthread instead of pthread? - Added by icy over 15 years ago

nicolas: Why do you think it's huge? Can you please elaborate? On my debian system, libglib2.0-0 is around 1 megabyte in filesize. Using it in an app consumes some kilobytes of ram and it doesn't result in significantly more cpu usage either when used right.
How do you define "big" dependency? And why do you say it is a bad library? You are only flaming without providing any substance to back up your claims whatsoever!
If those really minor things drive you back to apache... then be it. Good luck getting that lighter.

RE: Why do you use gthread instead of pthread? - Added by nicolas.sitbon over 15 years ago

Amazing, I asked which systems are supported by lighttpd and nobody answers, I said glib isn't the good choice and everybody screams!!!
Well to say you the truth, I say that glib is a bad choice because, it's a fact, glib is only a library and it's bigger than lighttpd, what's the fuck? just for thread, you're killing a fly with a train! I think the support of pthread is sufficient, no real need to support DCE, apache has made the choice to support all plateform and the code is horrible and performance bad. I don't like the way glib is implemented, redefinition of basic and extended type, illusory OOP model programming with Gobject, too heavy. My advice is keep it simple as possible, don't depend on multiple libraries. I don't have glib on my system and I don't want it.

RE: Why do you use gthread instead of pthread? - Added by stbuehler over 15 years ago

I don't know the answer to your "which systems are supported?" question, so how should i answer it?
And why is it a problem to use a library which is bigger than your application? I see nothing wrong with that. If someone wants to use it on an embedded system, he just has to compile the parts of the library the application needs... and we will certainly not reinvent the wheel just to make these guys happy.
Your arguments just suck. No real evidence... just "I don't like it, it's bad, it's a fact". And we don't care about your opinion.

RE: Why do you use gthread instead of pthread? - Added by jan over 15 years ago

Before we throw more rocks ... please read the source of gthread/gthread-posix.c

AND if you look at the size of libs, also look at the right lib:

$ ls -l /opt/local/lib/libgthread-2.0.*
-rwxr-xr-x 2 root admin 24572 17 Okt 21:07 /opt/local/lib/libgthread-2.0.0.1800.1.dylib

Do we use GObject ? No.

Have we written our own implementations of GString, GHashTable and GPtrArray ? Yes. If you compare the implementation, you see that glib's is better. So ? What is the benefit of NIH ?

RE: Why do you use gthread instead of pthread? - Added by nicolas.sitbon over 15 years ago

No the real question is which systems are supported by lighttpd, because if you say all modern Unix + Windows, glib isn't justify and phtreads are sufficient but nobody answers that question and sorry for my bad english.

RE: Why do you use gthread instead of pthread? - Added by darix over 15 years ago

You really miss the point. Jan started using glib for more than just threads. lighttpd-sandbox (from icy and stbuehler) completely went this way. so instead of inventing/keeping our own implementation of buffer(now GString), hashes (GHashTable), array(GPtrArray), we now use the glib in jan's 1.5 branch and in the sandbox.

besides that lighttpd supports most modern unices and windows via cygwin.

and if you wonder why people jumped on your glib rant, that is simple. your rant didnt have any real arguments and therefor just useless.

    (1-14/14)