gedit is just a text editor , maybe your teacher use it in order to write code.
For implementing pthread you can use a IDE such like codeblocks , it's free.
open a new project , and in build option -> lincker setting add : pthread , finally include in your project "pthread.h" then you can create , destroy .threads as you want