Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 11 years ago

Closed 3 years ago

#246 closed enhancement (wontfix)

Make working directory a per-thread property

Reported by: Jiri Svoboda Owned by:
Priority: minor Milestone:
Component: helenos/lib/c Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:


Currently the working directory is a property of the task as a whole (same as in POSIX). This is incompatible with multi-threaded applications.

I propose to change WD to be a thread(fibril)-local property.

Compatibility analysis: This will not affect single-threaded POSIX applications. This could only break multi-threaded POSIX applications that rely on setting WD in one thread and then accessing it in another. It could be fixed in the prospective POSIX compatibility layer, however.

Change History (7)

comment:1 Changed 11 years ago by Jakub Jermář

I am concerned about the possible complications this could cause given the way we use kernel threads - i.e. as execution units for fibrils.

comment:2 Changed 11 years ago by Jakub Jermář


comment:3 Changed 11 years ago by Jiri Svoboda

I don't quite follow. Can you elaborate on this and perhaps give an example?

comment:4 Changed 11 years ago by Jakub Jermář

This was a reaction to making it a per-thread property. As fibrils can move among threads, their cwd would change accordingly. If it was a per-fibril property, I don't see any problem.

comment:5 Changed 11 years ago by Jakub Jermář

Type: proposalenhancement

comment:6 Changed 10 years ago by Jakub Jermář

Milestone: 0.5.0

comment:7 Changed 3 years ago by Jiri Svoboda

Resolution: wontfix
Status: newclosed

I changed my mind. Global state is bad. Thread- or fibril-specific global state is even worse. If an application requires more fine control, it should specify the base directory explicitly.

Note: See TracTickets for help on using tickets.