DaemonForums  

Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 19th January 2016
e1-531g e1-531g is offline
Spam Deminer
 
Join Date: Mar 2014
Posts: 312
Default Differences between processes and threads in Linux and *BSD (i.e. OpenBSD)

Hello,
I have read blog post about processes and threads. I would like not to post link here, because this is not in English. It basically says that *BSD's processes and threads model at the lower layer are different than in example Linux kernel.
I would like to learn more, but I don't know where to search. I seek for information about differences between these kernels/operating systems, which are practical, pragmatic for somebody who wants to write some userspace programs, which will not be included in base of *BSDs. I would like to use this knowledge in C language.
***
Added:
I don't want to mean that I don't actually know conceptual difference between process and thread. I seek differences in these two fields:
1. threads in Linux - threads in *BSDs
2. processes in Linux - processes in *BSDs

Last edited by J65nko; 2nd February 2016 at 08:54 PM. Reason: fixed typo: differencies -> differences
Reply With Quote
  #2   (View Single Post)  
Old 19th January 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,635
Default

I can speak, sparingly, to threads.

POSIX.1c, Threads Extensions (IEEE Std 1003.1c-1995) defined thread APIs, so if you use pthreads() there should not be a programmatic difference between POSIX-compliant operating systems, with the understanding that the supporting libraries and kernel syscalls may be very different.

But the BSDs do not all use the same technologies. And within a single BSD, the underlying services may change -- OpenBSD replaced its underlying thread technology in 2012. That new RThreads technology had been in development for seven years.

Last edited by jggimi; 19th January 2016 at 06:09 PM. Reason: added RThreads referernce and link
Reply With Quote
  #3   (View Single Post)  
Old 2nd February 2016
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,260
Default

Quote:
Originally Posted by e1-531g View Post
I seek for information about differences between these kernels/operating systems, which are practical, pragmatic for somebody who wants to write...
The definitive source is the source code itself.

While Linux has a much larger community where some books have been written (eg. Understanding the Linux Kernel), the closest tome from the BSD perspective is The Design and Implementation of the 4.4BSD Operating System.

Note that both books cited are dated.

The reason books on this subject are dated is because both the writing & the knowledge is tedious. While there is a market for such books, publishers are not excited on books such as this because the potential markets are small.

...& given that the implementations change, books on the subject quickly lose relevancy.

How developers & aspiring developers learn about these subjects in depth is simply to study the source code itself. There really is no shortcut.
Reply With Quote
  #4   (View Single Post)  
Old 2nd February 2016
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,496
Default

The latest edition of the Marshall Kirk McKusick book is from 2014, has 2 co-authors (George V. Neville-Neil and Robert N.M. Watson) and covers FreeBSD.
This edition is called The Design and Implementation of the FreeBSD Operating System.

I don't have the book, but according to the Amazon "Look inside", chapter IV covers processes and threads.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #5   (View Single Post)  
Old 3rd February 2016
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,260
Default

Quote:
Originally Posted by J65nko View Post
The latest edition of the Marshall Kirk McKusick book is from 2014, has 2 co-authors (George V. Neville-Neil and Robert N.M. Watson) and covers FreeBSD.
This edition is called The Design and Implementation of the FreeBSD Operating System.
...& when this subject comes up on (repeatedly) on misc@, mention usually points out that for information on OpenBSD, going to the previous edition on 4.4BSD is more relevant.
Reply With Quote
Reply

Tags
parallel, processes, programming, threads

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenBSD 4.7 Kernel threads support rohitk OpenBSD General 6 28th July 2010 05:28 AM
See processes on other servers? biscuits FreeBSD General 2 20th January 2009 04:15 AM
disappearing threads crayoxide Feedback and Suggestions 9 13th August 2008 01:07 AM
chmods for users & hiding processes mike OpenBSD Security 2 12th June 2008 04:15 PM
Zero-reply threads anomie Feedback and Suggestions 5 22nd May 2008 02:54 PM


All times are GMT. The time now is 09:08 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick